I have the latest stable version of paragraphs installed and the 8.x-3.x version of the field group module installed. I'm getting the following ajax error when trying to create a paragraph via the admin.
TypeError: Argument 2 passed to field_group_field_group_form_process_build_alter() must implement interface Drupal\Core\Form\FormStateInterface, null given, called in /srv/bindings/code/web/core/lib/Drupal/Core/Extension/ModuleHandler.php on line 539 in field_group_field_group_form_process_build_alter() (line 429 of /srv/bindings/code/web/modules/contrib/field_group/field_group.module)
#0 /srv/bindings/code/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(539): field_group_field_group_form_process_build_alter(Array, NULL, Array)
#1 /srv/bindings/code/web/modules/contrib/field_group/field_group.module(338): Drupal\Core\Extension\ModuleHandler->alter('field_group_for...', Array, NULL, Array)
#2 /srv/bindings/code/web/modules/contrib/field_group/field_group.module(276): field_group_form_process(Array)
#3 [internal function]: field_group_form_pre_render(Array)
#4 /srv/bindings/code/web/core/lib/Drupal/Core/Render/Renderer.php(378): call_user_func('field_group_for...', Array)
Looks like there has been a lot of movement on this branch in the past 5 days, so I decided to revert back to a commit hash before those changes and it fixes this issue. Has anyone else run into this?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | field_group-fatal_error_with_paragraphs-3041519-4.patch | 697 bytes | justin2pin |
| #3 | field_group-fatal_error_with_paragraphs-3041519-3.patch | 973 bytes | justin2pin |
Comments
Comment #2
justin2pin commentedI just got the same error. What commit did you roll back to?
Comment #3
justin2pin commentedA recent commit made $form_state and $form parameters optional here:
function field_group_form_process(array &$element, FormStateInterface $form_state = NULL, array &$form = []) {But not in the subsequently called hook_field_group_form_process_build, here:
function field_group_field_group_form_process_build_alter(array &$element, FormStateInterface $form_state, array &$form) {Attached patch makes the $form_state and $form parameters optional for hook_field_group_form_process_build and solves this issue in my environment.
Comment #4
justin2pin commentedApologies, I should have looked closer at that last patch. This should be the correct one.
Comment #5
rivimey@justin2pin I encountered the same problem, and decided to fix it by making the form_state arg nullable:
This is a php 7.1 feature, which is works for me on 7.2 but I'm not sure if it's generally ok at present. Php 7.0 has already reached official end-of-life, and is due to be dropped from D8 imminently.
I'm not sure if your patch:
is equivalent to mine in this regard or not.
In some ways I'd prefer that the type was left out of the php signature for the moment.
Comment #6
rivimeyTweak issue description length, make 'pre'.
Comment #7
jsheffers commentedThe patch listed here won't apply for me with the latest dev commit. @justin2pinThis patch does apply and it works.
However the fields in my groups are not grouping properly anymore.Edit: Looks like I need the paragraphs patch here:
https://www.drupal.org/files/issues/2907094_7_field_group_support.patch
All works fine now.
Comment #8
sime@jsheffers isn't that patch in Paragraphs 8.x-1.7 already? Which version of Paragraphs are you using?
Comment #9
jsheffers commented@sime we're using 8.x-1.7, didn't seem to be working before the patch...
Comment #10
simeThanks. I'll try and verify this - there is a pending RC I believe and a regression with paragraphs is not ideal :P
Comment #11
kumkum29 commentedOk for me with the patch #4.
Do you think include this correction in the dev version?
thanks.
Comment #13
nils.destoop commentedThx for the patch. I committed it to dev
Comment #14
nils.destoop commentedI temp removed the typehint, as drupal 8.6 still supports php 5.6