Undefined index: #parents FormState.php

Created on 21 January 2019, over 5 years ago
Updated 6 August 2024, about 1 month ago

Problem/Motivation

Notices appear when trying to save content with missing required entity reference to media field.

Notice: Undefined index: #parents in Drupal\Core\Form\FormState->getError() (line 1112 of core/lib/Drupal/Core/Form/FormState.php).

Warning: Invalid argument supplied for foreach() in Drupal\Core\Form\FormState->getError() (line 1112 of core/lib/Drupal/Core/Form/FormState.php).

Proposed resolution

Use defensive programming to verify that the "#parents" array key exists before accessing it.

Remaining tasks

Respond to #37 and #50.
Review
Commit

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Form 

Last updated 1 minute ago

Created by

🇧🇬Bulgaria nmitev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024