Problem/Motivation
Inability to change settings
Steps to reproduce
- Create a field group and save it
- Click the settings "cog" icon
- An error 500 is being raised
Proposed resolution
1) Disable the module
2) Modify bootstrap_fieldgroup.module - Line #116
From:
$form = array(
'instance_settings' => array(
'#tree' => TRUE,
'#weight' => 5,
),
);
To:
$form = array(
'instance_settings' => array(),
);
The error is happening because once module_invoke_all gets called, multiple methods return entries for the entries the $form array.
- field_group_field_group_format_settings
- bootstrap_fieldgroup_field_group_format_settings
Inside the method module_invoke_all, a call to array_merge_recursive converts the '#tree' and '#weight' entries to arrays making the method element_children crash, because '#weight' is expected to be number/scalar not an array.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3191992-3.patch | 525 bytes | aritrika.d |
Issue fork bootstrap_fieldgroup-3191992
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mojiro commentedComment #3
aritrika.d commentedCreated a patch for this issue,please review the patch
Comment #4
aritrika.d commentedComment #5
mojiro commentedIt looks good aritrika.d. Thank you for your quick response.
Comment #6
yntun commented@aritrika.d the patch works, thanks for that.
Comment #7
abelaguado commentedDrupal 7.77
Bootstrap_fieldgroup-7.x-1.x-dev
Patch doesn't work for me.
Back to this trick: https://www.drupal.org/project/drupal/issues/3187397#comment-13951603
Comment #8
julien.reulos commentedThe patch is working fine, thanks! Drupal 7.77 + bootstrap_fieldgroup 7.x-1.2.
Comment #9
ilfelice commentedHowdy,
Tried the patch on #3, and the problem persists. Using Drupal 7.77 + bootstrap_fieldgroup 7.x-1.2.
I forgot to disable the module before applying the patch; does that make a difference?
Any ideas on where I can further look at will be greatly appreciated.
Comment #10
mojiro commentedComment #11
mojiro commentedHello jorgemare and abelaguado,
Could you please describe your settings? are you able to provide any log entries?
Would you like to try one more patch?
Instead of:
... please try:
jorgemare,
you do not need to disable the module to make the patch effective.
Comment #12
abelaguado commentedHi mojiro.
Same Error with your last suggestion:
$form = array();Instead of:
"Error: Unsupported operand types en element_children() (línea 6671 /includes/common.inc"
Drupal 7.77
Bootstrap_fieldgroup-7.x-1.x-dev
Thanks for your help.
Comment #13
ilfelice commentedHi @mojiro!
Thank you for your fast response.
I tried the latest change, but the error persists.
This is a fairly big site, with several content types and paragraph bundles. I use Field Group and Bootstrap Field Group to format both the edit forms and the display of content. Been using this setup for several years now, and it has always worked fine.
Now, this error occurs whenever I try to edit any (regular or bootstrap) field group, regardless of whether it is in a content type or a paragraph bundle.
I do not see anything related in the dblog. Is there anywhere else I should be looking perhaps?
Thanks again for your help!
Comment #15
ilfelice commentedHowdy,
I tried running the same site I am having problems with to PHP 7 (currently PHP 5.6), to see if it was PHP related.
Unfortunately, it made no difference. :(
Just FYI.
Comment #16
paulocsHey jorgemare,
My solution for my case was that the hook_field_extra_fields was called two times in different modules and both were adding the weight for the same element. And as the issue description says, the
module_invoke_allhas anarray_merge_recursiveinside the function.The "problem" was in the hook_field_extra_fields in the i18n module and in a custom module that I have in my project.
Maybe the problem in you project isn't in the Bootstrap fieldgroup module.
Comment #17
jrochate commentedIn my case I had to do a similar change on field_group/field_group.module on line 451:
'instance_settings' => array()
With both changes, there is no more AJAX error.
Comment #18
jrochate commentedComment #19
ilfelice commentedHi jrochate!
That did the trick! Thank you so much!
Comment #21
cha0s commentedThank you! It's been committed to the dev branch.