With Drupal 8.0.0-beta13, a fatal error is issued from the field_collection module:
PHP Fatal error: Class 'Drupal\system\Controller\FormAjaxController' not found in /home/vagrant/docroot/modules/contrib/field_collection/src/Controller/FieldCollectionWidgetAjaxController.php on line 16
On further research, it looks like FormAjaxController was removed from core as a result of #2502785: Remove support for $form_state->setCached() for GET requests
There is a change record at https://www.drupal.org/node/2501435 but it does not yet describe the replacement for using FormAjaxController.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | fc-ajax-fix-2544676-2.patch | 7.71 KB | paulmckibben |
Comments
Comment #1
paulmckibbenBeen trying to understand the implications of this change. According to the issue description in #2502785: Remove support for $form_state->setCached() for GET requests, field_collection and any other contrib module that used FormAjaxController will have to be refactored to use an ajax callback instead of a URL.
What I think this means:
Comment #2
paulmckibbenI have an initial patch (attached). However, I have found that when I edit a node that uses a multi-valued field_collection field, after saving the node, the field collections disappear from it. I'm not sure if it is because of this patch or part of another issue. More investigation required.
I welcome anyone's help.
Comment #3
floretan commentedI ran into the same issue that field values are not getting stored anymore. This happens independently of this patch.
Comment #4
floretan commentedI solved the issue with the saved values in #2558001: Field values are not saved.
This patch applies cleanly and works as expected.
Comment #6
jmuzz commentedThanks, committed.