I am seeing this error notice on the edit page of a node with Fieldsets. In particular, if the fieldset has a description but no ID attribute, then I get the error.

Here is the message:

Notice: Undefined index: id in template_preprocess_fieldset() (line 217 of core/includes/form.inc).

It looks like the following code is the culprit. So I'm not sure if that's actually a core issue or an issue where the Field Group module needs to require an ID or provide a default one.

$description_id = $element['#attributes']['id'] . '--description';

Comments

inversed created an issue. See original summary.

inversed’s picture

Issue summary: View changes
Grimreaper’s picture

Version: 8.x-1.0-rc6 » 8.x-1.x-dev
Status: Active » Needs review
FileSize
2.53 KB

Hello,

I encountered the same issue. Putting an id when there is a description filled on the field group type settings fixed the problem.

So here is a patch that raises an error when setting a description but no id.

It also fixes the current ID and CSS class validation because in Drupal::formBuilder()->setError, there is no setError() method.

Thanks for the review.

amit.sharma.aust’s picture

Hi,

I had the similar issue but applying field_group-fix_settings_validation-2849759-3.patch solved my problem.

When I was creating general type content as developer, it was working fine. But when I was creating general type content as administrator, it was throwing following error on the create content page:

Notice: Undefined index: id in template_preprocess_fieldset() (line 217 of core/includes/form.inc).

And the cause of the error was description field of field_group. When I kept the description field of field_group empty it worked fine (even when I was logged in as administrator) but as soon as I put some description in it, it threw the error message.

Thanks for the solution.

geerlingguy’s picture

Status: Needs review » Reviewed & tested by the community

RTBC - this error was a bit annoying on any page where there was a Field Group with a description but no ID. The patch fixes the main issue. Alternatively, a patch could make the ID optional, but that would change the behavior of the module.

pdenooijer’s picture

Bug still exists but patch does not apply :(.

pdenooijer’s picture

Status: Reviewed & tested by the community » Needs work