- 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 - @serkanb opened merge request.
- πΊπΈ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); }