Fatal error with Drupal 10.2.x

Created on 8 November 2023, 8 months ago
Updated 11 January 2024, 6 months ago

Problem/Motivation

Creating or editing a custom field throws a error 500, looking in the php log
"Uncaught PHP Exception RuntimeException: "The subform and parent form must contain the #parents property, which must be an array. Try calling this method from a #process callback instead." at /web/core/lib/Drupal/Core/Form/SubformState.php line 80"

Steps to reproduce

Try to create or edit a custom field

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇮🇹Italy Giuse69

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

Comments & Activities

  • Issue created by @Giuse69
  • Status changed to Postponed 8 months ago
  • 🇺🇸United States apmsooner

    Thanks for reporting. Considering its alpha version, will have to postpone looking into this as a major version update in custom_field to support the new field changes outlined: https://www.drupal.org/node/3386675 . Recommend sticking with 10.1.x version of core for now since 10.2.x is not yet recommended for production anyway.

  • 🇺🇸United States boinkster

    I hit this with 10.2.0 today... I'll dig a bit and see what I can find.

  • 🇮🇪Ireland marksmith

    I can confirm this. It appears that several pretty significant changes were introduced field-wise in Drupal 10.2, which causes much trouble to field-related modules, among others to Custom field.

  • 🇺🇸United States thejimbirch Cape Cod, Massachusetts

    10.2 has a full release now and this is a blocker as it is giving fatal errors. Should this be un-postponed?

  • 🇺🇸United States thejimbirch Cape Cod, Massachusetts
  • Status changed to Active 6 months ago
  • 🇺🇸United States apmsooner

    Moving to active status.

  • 🇺🇸United States apmsooner

    Setting version to new 3.0.x-dev branch to start working on this issue there. New release for 2.x limits core version to max ^10.1.

  • 🇺🇸United States nadavoid

    I was able to update to Drupal core 10.2.1 combined with custom_field 2.0.0-rc6. I believe the constraint in custom_field's composer file needs to be made more strict.

    Currently: "drupal/core": "^9.4 || ^10.1" allows effectively any version of 10.

    Suggested: "drupal/core": "^9.4 || ~10.1.0".

    The ~ "specifies a minimum version, but allows the last digit specified to go up." More details on that: https://getcomposer.org/doc/articles/versions.md#tilde-version-range-

    Additionally, are there any suggestions of where to start looking to fix the issue?

  • 🇺🇸United States apmsooner

    Ahh.. yes I missed that. Does .info.yml need also to follow the same pattern for core_version_requirement?

  • 🇺🇸United States nadavoid

    I think so. I haven't tested those constraints in a .info.yml file myself, but this page says so.

    The core_version_requirement key in *.info.yml files for modules, themes, and profiles now supports semantic versioning as implemented by the Composer project.

    Nice to have a single standard for version constraints!

  • Status changed to Fixed 6 months ago
  • 🇺🇸United States apmsooner

    Alpha release on the way. Its not perfect yet but its functional enough to prevent the fatal error. The major problem to solve now is to somehow sync storage and field settings on changes via ajax since they are now combined in the same form. Appreciate any help if someone wants to contribute.

  • Status changed to Fixed 6 months ago
Production build 0.69.0 2024