Problem: any validate and submit handlers added by eminline could overwrite other modules' handlers.
See this parallel issue on wysiwyg_filter: #746434: Filter form validate and submit handlers overwritten.
Steps to reproduce:
1. enable wysiwyg_filter module. Apply WYSIWYG filter to Filtered HTML format.
2. Enable eminline module and emvideo module. Apply embedded media filter to Filtered HTML format.
3. Configure this input format. Select changes for both emfield_filter and wysiwyg_filter. Submit.
4. Changes are saved for wysiwyg_filter but not eminline filter.
Source: In filter_admin_configure(), filter module uses array_merge() to merge filter forms from distinct modules providing filters.
$form = array_merge($form, $form_module);
This means that any common keys, e.g., #submit, #validate, declared by one module are overwritten by later modules.
Fix: use hook_form_alter() to add validate and submit handlers.
I'll post a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 772306-1-emfield-DRUPAL-6--2.patch | 1.6 KB | nedjo |
Comments
Comment #1
nedjoPatch. We can't append to the #submit array because we need to ensure this module's submit handler comes before system_settings_form_submit().
Comment #2
Gyt commentedwysiwyg_filter produced many errors for me. Now they are gone. Thanks for patch!
Comment #3
aaron commentedthanks @nedjo! committed.