Problem/Motivation

      $this->accountSwitcher->switchTo(new UserSession(['uid' => $options['uid']]));

Does not seem to work, in my case when supplying ID 3 it thought I wanted to run the drush command as anonymous. The following does work:

      $this->accountSwitcher->switchTo(User::load($options['uid']));

Steps to reproduce

  • Create a view with an access check
  • Create an account with UID 2 (or whatever) with zero permissions
  • Run the drush command with the uid flag set to 2 (or whatever) and see it fail

Proposed resolution

Fully load the user, see above

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kristiaanvandeneynde created an issue. See original summary.

kristiaanvandeneynde’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev

Wrong version, sorry.

kristiaanvandeneynde changed the visibility of the branch 3581446-viewsdataexportcommandsviewsdataexport-does-not to hidden.

kristiaanvandeneynde’s picture

Status: Active » Needs review
steven jones’s picture

Status: Needs review » Reviewed & tested by the community

Yeah, seems to make sense to do this.

steven jones’s picture

Thanks very much for the find and the MR.

steven jones’s picture

Status: Reviewed & tested by the community » Fixed

Fixed, will do a release with this in a few days.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

kristiaanvandeneynde’s picture

Awesome, thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.