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

Help with plugin chaining #21

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Help with plugin chaining #21

wants to merge 8 commits into from

Conversation

jcdm
Copy link

@jcdm jcdm commented Jan 10, 2018

At present, it's difficult to do anything with the result of a FileSluggy rename. Only the old and new file names are passed to the FileSluggyOnUpdateFileName event whereas to have something work on the files, it'll also want the media source, upload directory and the other details stored in the $files variable.

This update adds those to the event trigger as well as adding a system-setting to allow the user to force the FileSluggyOnUpdateFileName event to be triggered with the original file upload information in the event that a rename wasn't actually required.

Doing it this way allows plugins to 'hitch their wagon' to the event REGARDLESS of whether a file rename took place. The alternative would be to trigger on both the FileSluggyOnUpdateFileName event AS WELL AS the OnFileManagerUpload event, knowing that one or the other was going to find its target file missing and be the wrong code to run.

Would require insertion of new 'nl' lexicon items - I've only added the English as it's all I know.

jcdm added 8 commits January 10, 2018 22:00
Adds a field to select yes/no to triggering the FileSluggyOnUpdateFilename event even if a rename wasn't required
Adds a field to select yes/no to triggering the FileSluggyOnUpdateFilename event even if a rename wasn't required
…t required

Adds additional $files, $source and $directory arrays to the FileSluggyOnUpdateFilename hook and optionally, based on system setting, runs it even if a rename isn't required so that another plugin can run reliably based on its results.
Code to trigger event for norename was in the wrong spot in the chain of logic
Rename the previously added filesluggy.triggerFSOUFEventOnNoRename event to filesluggy.forceFSOUFEvent
Rename the previously added filesluggy.triggerFSOUFEventOnNoRename setting to filesluggy.forceFSOUFEvent
Rename the previously created filesluggy.triggerFSOUFEventOnNoRename to filesluggy.forceFSOUFEvent
@jcdm
Copy link
Author

jcdm commented Feb 5, 2021

Just reapplied these fixes to keep the latest version working. +1 vote (do I get a second vote 2+ years on? 😅) to have these changes integrated into the base to allow people to chain things to treat uploads following FileSluggy sanitisation.

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

Successfully merging this pull request may close these issues.

1 participant