- Issue created by @jeffm2001
- 🇩🇪Germany SerkanB
The easiest fix would be to implement the form_alter with the new ID and call the old form_alter...
function focal_point_form_media_library_add_form_dropzonejs_alter(array &$form, FormStateInterface $form_state) { focal_point_form_media_library_add_form_upload_alter($form, $form_state); }
But this feels wrong, having some hook of a random contrib module. Is this the way to go?
- last update
over 1 year ago 158 pass - 🇺🇸United States jeffm2001
Having a hook that alters the
media_library_add_form_dropzonejs
form is not really any different than altering themedia_library_add_form_upload
form. 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. - 🇨🇦Canada laura.j.johnson@gmail.com Toronto
This works for me using focal_point 2.0.
- 🇬🇧United Kingdom nickrhymes
Am 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.function MODULE_NAME_form_media_library_add_form_dropzonejs_alter(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) { focal_point_form_media_library_add_form_upload_alter($form, $form_state); }
- 🇺🇸United States lefteous
Any 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. - 🇺🇸United States jeffm2001
We've been using this fix for 2 years now without issue.
- First commit to issue fork.