Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix single "ScopeContext" passed to "setScopes" #19989

Merged
merged 1 commit into from
Mar 17, 2020

Conversation

danxuliu
Copy link
Member

setScopes expects an array, but a single ScopeContext was being passed instead.

How to test

  • Enable the Talk app
  • Create a new conversation named Test
  • Open the Flow personal settings
  • Create a new Write to conversation flow When file created and mime type is folder then write to conversation Test
  • Open the Files app
  • Create a new folder and share by link with permissions to upload and edit
  • Copy the share link
  • In a private window, open the share link
  • Create a new folder

Result with this pull request

The folder appears in the list.

Result without this pull request

The error Could not create folder is shown (although if the public share page is reloaded it can be seen that the folder was actually created).

"setScopes" expects an array, but a single "ScopeContext" was being
passed instead.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu added this to the Nextcloud 19 milestone Mar 16, 2020
@danxuliu
Copy link
Member Author

/backport to stable18

@kesselb
Copy link
Contributor

kesselb commented Mar 16, 2020

Nice finding 👍

image

I was really wondering why PHPStorm does not complain about those code. It seems that for some reason /** @var ScopeContext $scopeCandidate */ is ignored but if we annotate $additionalScopes with /** @var ScopeContext[] $additionalScopes */ it works. So I would like to suggest to annotate it correctly as additional step.

Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rullzer rullzer merged commit e193e14 into master Mar 17, 2020
@rullzer rullzer deleted the fix-single-ScopeContext-passed-to-setScopes branch March 17, 2020 14:08
@backportbot-nextcloud
Copy link

backport to stable18 in #20001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants