Problem/Motivation
The following notice appears:
Notice: Trying to access array offset on value of type null in ctools_entity_form_field_content_type_admin_title() (line 164 of ctools/plugins/content_types/form/entity_form_field.inc).
Steps to reproduce
- Edit a panel node edit page content with field groups e.g.
/admin/structure/pages/nojs/operation/node_edit/handlers/node_edit__panel_context/content - Observer the above notice
Proposed resolution
As field_info_instance() doesn't work for field groups use field_group_info_groups() instead.
Remaining tasks
- Review and commit
User interface changes
- Field groups now have labels
- Associated PHP notice no longer appears
API changes
- None
Data model changes
- None
Issue fork ctools-3213534
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 #3
mustanggb commentedComment #4
wylbur commentedComment #5
joelpittet@MustangGB, why not take care of this case in field_group module? Or a generic way that doesn't tie it to field_group module so closely.
Comment #6
mustanggb commented@joelpittet
The reason being that
ctoolsalready hasfield_groupspecific code that is pretty much exactly the same thing as my code in other areas of the module, see #2222513: Provide Field Group panes for entity edit forms.So it seems to make more sense and is easier to add a few lines of code here that are consistent with the existing code than to rip out existing code and re-write
field_groupto behave as a fake field, or however you'd need to do it.Or in other words, this was missed from the original commit in #2222513: Provide Field Group panes for entity edit forms, but no-one bother to look at fixing it until it started producing notices.
Comment #7
joelpittet@MustangGB thanks for the context, there is a minor new notice potential in the code, I commented. I'll commit once that is resolved.
For reference: https://3v4l.org/c3o8K
Comment #8
mustanggb commentedSomething like this?
Comment #10
joelpittetThanks @MustangGB that seems like a reasonable default, I've merged, and issue credit is apparently a thing with merging... but it got you as the author so at least that worked.
Comment #11
mustanggb commentedThanks.