Notice: Undefined index: #parents in a Form/FormElementHelper.php

Created on 15 June 2020, almost 5 years ago
Updated 14 June 2023, almost 2 years ago

Seeing this Notice when saving a node edit form:

Notice: Undefined index: #parents in /app/core/lib/Drupal/Core/Form/FormElementHelper.php.
πŸ› Bug report
Status

Needs work

Version

9.5

Component
FormΒ  β†’

Last updated 1 day ago

Created by

πŸ‡ΊπŸ‡ΈUnited States brooke_heaton

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

Comments & Activities

Not all content is available!

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

  • The problem this patch is addressing was throwing only notices on PHP 7.4 but is throwing errors on PHP 8+, so the patch is valid I think. Steps to reproduce this using the focal_point module:

    On Vanilla Drupal 9.5+

    • Enable the modules media, media_library and focal_point
    • Add an image style with a focal_point image effect
    • Configure the media_library form display of image media to use the Image (Focal point) field widget
    • Add a media field to the article content type
    • Configure the form display of the article content type to use the media_library widget
    • Add an article and add a media to the article by uploading a new image
    • After uploading the image, do not enter an alt text and click save

    There will be an ajax error originating from the location in code the patch here changes.

  • Status changed to Needs work about 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    If valid it will need a test case to show the issue.

    Though not sure that’s a fix that would get committed. This may be covering a symptom of a bigger issue. Like why is that value not set when it gets to this point?

    But either way tests will 100% be needed

  • πŸ‡­πŸ‡ΊHungary szato

    Maybe related to Focal point image widget causes validation errors not to be shown πŸ› Focal point image widget causes validation errors not to be shown Needs work ?

Production build 0.71.5 2024