Skip to content

Include the share in the Files_Sharing::loadAdditionalScripts event - #17575

Merged
rullzer merged 1 commit into
masterfrom
include-the-share-in-the-files_sharing-loadadditionalscripts-event
Oct 19, 2019
Merged

Include the share in the Files_Sharing::loadAdditionalScripts event#17575
rullzer merged 1 commit into
masterfrom
include-the-share-in-the-files_sharing-loadadditionalscripts-event

Conversation

@danxuliu

Copy link
Copy Markdown
Member

This provides a better context for apps using the event, for example to load one script or another depending on whether the share is a file or a folder.

This should be backported to Nextcloud 17, as it is needed by Talk to fix some issues in the public share page for folder shares.

@danxuliu

Copy link
Copy Markdown
MemberAuthor

/backport to stable17

@danxuliu

Copy link
Copy Markdown
MemberAuthor

Wait, do not review yet 🤦‍♂️

@danxuliudanxuliu added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Oct 17, 2019
@danxuliu

Copy link
Copy Markdown
MemberAuthor

Done.

The tests passed because only the first parameter was being checked; I have extended them to also test the new parameter.

I have also changed the parameter from $this->share to $share; in the real world it should not matter, as $this->share is automatically set to $this->shareManager->getShareByToken($this->getToken()) in isValidToken()before the controller is executed, but $share is used throughout showShare() instead of $this->share, so keep consistency with that.

@danxuliudanxuliu added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 17, 2019

@rullzerrullzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Those should be converted to the new events 😉

But sure.

This provides a better context for apps using the event, for example to
load one script or another depending on whether the share is a file or a
folder.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu
danxuliuforce-pushed the include-the-share-in-the-files_sharing-loadadditionalscripts-event branch from f6c38e5 to 5c7c308CompareOctober 17, 2019 16:24
@danxuliu

Copy link
Copy Markdown
MemberAuthor

Squashed.

@rullzer
rullzer merged commit b425b34 into masterOct 19, 2019
@rullzer
rullzer deleted the include-the-share-in-the-files_sharing-loadadditionalscripts-event branch October 19, 2019 09:13
@backportbot-nextcloud

Copy link
Copy Markdown

backport to stable17 in #17597

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsfeature: sharing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@danxuliu@rullzer@juliusknorr