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.

CommentFileSizeAuthor
#1 772306-1-emfield-DRUPAL-6--2.patch1.6 KBnedjo

Comments

nedjo’s picture

Status: Active » Needs review
StatusFileSize
new1.6 KB

Patch. We can't append to the #submit array because we need to ensure this module's submit handler comes before system_settings_form_submit().

Gyt’s picture

wysiwyg_filter produced many errors for me. Now they are gone. Thanks for patch!

aaron’s picture

Status: Needs review » Fixed

thanks @nedjo! committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.