Problem/Motivation
Focal Point used to work fine with the dropzonejs module and media library, but with #3341846: Set custom form id for media library form they changed the form id, and as a result, focal_point_form_media_library_add_form_upload_alter is no longer triggered.
Steps to reproduce
Proposed resolution
Change the hook to alter the base form id media_library_add_form and add any additional checks that are needed.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork focal_point-3344369
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
Comment #2
serkanb commentedThe easiest fix would be to implement the form_alter with the new ID and call the old form_alter...
But this feels wrong, having some hook of a random contrib module. Is this the way to go?
Comment #4
jeffm2001 commentedHaving a hook that alters the
media_library_add_form_dropzonejsform is not really any different than altering themedia_library_add_form_uploadform. I just did it this way in order to not repeat code.Perhaps it would look less weird if it was changed to a
hook_form_alter()with a condition to check the form ids inside the function.Comment #5
ltrainThis works for me using focal_point 2.0.
Comment #6
nickrhymes commentedAm seeing this issue with focal_point 2.0.2
Putting the suggestion from #2 in to a custom module resolves the issue for me as a workaround until fixed properly.
e.g.
Comment #7
lefteous commentedAny chance of this getting a dev review and merge?
The proposed hook does work well but we're hesitant to add it into a custom module at this point if it can be added into this project.
We have 1000+ sites that this change would be great for.
Comment #8
jeffm2001 commentedWe've been using this fix for 2 years now without issue.
Comment #11
rajeshreeputraMR merged!
Comment #13
markconroy commentedThanks for getting this merged, would it be possible to get a new release of Focal Point so people can start using it?
Comment #14
justcaldwellYes, please. +1 to tagging a new release.