We ran into this in the context of Organic Groups group pages, on which the river of news causes the subscription options form to be generated multiple times per page. The symptom is that while the form containing subscription options for the group node will display and submit, the form values will be evaluated against the first instance of the form (for the first node in the river of news) as opposed to for the group node itself.
Outside of Organic Groups group home pages, this issue can also be reproduced by creating a page view with a row style of "Node" and row style options of "Full Node". Ensure that "Form on node pages" is enabled in the general section of the Notifications UI admin page (admin/messaging/notifications/ui). Each node on the views-driven page will include the inline subscription options form. If you try to submit the form for any but the first result in the list, you can end up with incorrect subscriptions and/or "illegal choice" validation errors.
The attached patch does the following:
- Adds an implementation of hook_forms, to allow for calling the notifications_ui_options_form multiple times per page, but keeping each instance of the form unique.
- Alters the existing implementation of hook_nodeapi implementation to use a unique instance of the options form each time it is called.
- Alters notifications_ui_options_form to use the same submit handler for every instance of the form.
The patch uses the process described at the link below (and elsewhere) for using the same form multiple times on a single page:
http://www.computerminds.co.uk/drupal-6-multiple-instances-same-form-one...
| Comment | File | Size | Author |
|---|---|---|---|
| notifications_ui.module.patch | 1.52 KB | bdurbin |
Comments
Comment #1
bdurbin commentedFixing typo in title.
Comment #2
jose reyero commentedCommitted, thank you.