Wp-calypso: Site Picker: switching site to a site with lesser role on page not support throws console error (blank page)

Created on 13 Mar 2018  路  7Comments  路  Source: Automattic/wp-calypso

You need a user with access to two sites

Site 1: Administrator - can access 'domains'
Site 2: Author - can't access 'domains'

Steps to reproduce

  1. Starting at URL: https://wordpress.com/domains/manage for site 1
  2. Choose Switch Site
  3. Choose site 2

What I expected

Redirected to Calypso home - or unauthorized page

What happened instead

Blank screen with console error: TypeError: null is not an object (evaluating 'n.ID')

Browser / OS version

Chrome, Firefox, Safari on macOS

Screenshot / Video

switch sites

Context / Source

#dogfooding

Site Picker Sites [Type] Bug

Most helpful comment

@gwwar sounds perfect! Feel free to add us as reviewers. 馃檱

All 7 comments

@gwwar do you know if this is a recent regression? I'm pretty sure this used to work - at least handle this more gracefully

Should authors be able to access domains? We can probably go with what wp-admin does, though permissions differences may drift in the API (and we'd need to change it to match wp-admin).

Accessing the domains with a site slug set, and a current user of author, do we also see this?

@alisterscott I agree that a redirect or a not found logo would be more ideal, and would be the minimum work required. I don't recall any recent work around domains/related APIs, though anyone who takes the issue can check history on the related endpoints to see if there's anything suspicious.

Accessing the domains with a site slug set, and a current user of author, do we also see this?

In this case, what happens is it loses the site slug, and shows the site picker like this:

screen shot 2018-03-14 at 2 12 52 pm

The first site in the list is the site I am an author on, and if I choose it nothing happens when I click at all

Okay so the controller redirects, but doesn't handle site switching in the UI 馃憤 Thanks for verifying! Does @Automattic/cobalt have any time to look at this?

@gwwar we're at a conference, and then meetup next week. If you have time, feel free to pick it up. Otherwise, we can add it to our board.

@aidvu How this? I'll have Lannister take a look to fix client code, and we'll let Cobalt know if there are other endpoint tasks required.

@gwwar sounds perfect! Feel free to add us as reviewers. 馃檱

Was this page helpful?
0 / 5 - 0 ratings