When a form is updated by ajax in Drupal it should update the form_state so other modules can extend the form.
For example I am trying to make another part of the form change based on whatever is selected by this widget, but because the form state is never changed until the full form is submitted, its impossible to hook into this widget with ajax.

Comments

njbarrett’s picture

Issue summary: View changes
njbarrett’s picture

rooby’s picture

Category: Feature request » Bug report

Yes! I would say this is a bug because Drupal's usual form API functionality is not usable with this module.
I'm having to massively hack this module to achieve some relatively simple form altering.

Instead of the add another button doing something and then returning some updated form, it is firing up the view modal, which has its own form, then the ajax of that form is replacing elements on the original form. At the time it is being replaced there seems to be no reference to the original form anymore, which means any data that was in the form and not saved yet is gone.