Adding field groups causes errors

Created on 24 March 2024, 3 months ago
Updated 13 June 2024, 11 days ago

Problem/Motivation

Add field group > Select "Layouts", give it a label, select any layout, click "Save & Continue" > get 2 errors:

  1. Warning: Undefined property: stdClass::$group_name in Drupal\field_group_layout\Plugin\field_group\FieldGroupFormatter\LayoutFormatter->settingsForm() (line 73 of modules/contrib/field_group_layout/src/Plugin/field_group/FieldGroupFormatter/LayoutFormatter.php).
  2. Warning: Undefined array key "" in Drupal\field_group_layout\Plugin\field_group\FieldGroupFormatter\LayoutFormatter->settingsForm() (line 73 of modules/contrib/field_group_layout/src/Plugin/field_group/FieldGroupFormatter/LayoutFormatter.php).

Then go add or edit a content for which the field group layouts were used, get another 2 errors, repeated for the amount of layout elements that were added:
Warning: include_once(/var/www/html/web/core/modules/layout_discovery/layouts/onecol/templates/theme.inc): Failed to open stream: No such file or directory in include_once() (line 237 of core/lib/Drupal/Core/Theme/ThemeManager.php).
Warning: include_once(): Failed opening '/var/www/html/web/core/modules/layout_discovery/layouts/onecol/templates/theme.inc' for inclusion (include_path='/var/www/html/vendor/pear/archive_tar:/var/www/html/vendor/pear/console_getopt:/var/www/html/vendor/pear/pear-core-minimal/src:/var/www/html/vendor/pear/pear_exception:.:/usr/share/php') in include_once() (line 237 of core/lib/Drupal/Core/Theme/ThemeManager.php).

Plus this one at the end:
Warning: Undefined array key "#wrapper_element" in template_preprocess_field_group__layout_twocol_bricks() (line 207 of modules/contrib/field_group_layout/templates/theme.inc).

Now remove all the "Layouts" fielg groups from that entity type manage form display, go back to edit the entity and you get even more errors (3 for every layout template).

Tested on a new dev site on Drupal 10.2.4 (core-recommended), with Gin Admin Theme 8.x-3.0-rc9 enabled and Layout Builder & Field Layout disabled.

๐Ÿ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡นItaly kopeboy Mainland

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

Merge Requests

Comments & Activities

  • Issue created by @kopeboy
  • ๐Ÿ‡ช๐Ÿ‡ธSpain ady1503

    Same issue.

    Need patch.

  • Assigned to adarshv
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia adarshv
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia adarshv
  • praveen rani โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !4Update LayoutFormatter.php โ†’ (Open) created by praveen rani
  • To resolve the above warning messages, I have created MR please review it.

  • Status changed to Needs work 2 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Rajan Kumar@2026

    hii @kopeboy

    i am not getting error Add field group > Select "Layouts", give it a label, select any layout, click "Save & Continue" refrence schreenshot attached hare.

  • Status changed to Needs review 2 months ago
  • Status changed to Needs work about 2 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ดNorway matsbla

    I tested this patch, but I still received the same error:
    https://git.drupalcode.org/project/field_group_layout/-/merge_requests/4.diff

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aman1248

    Amandeep123 โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !6Update LayoutFormatter.php โ†’ (Open) created by Unnamed author
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aman1248

    hy @matsbla, please review merge request 6 as this error is resolved on my site .
    thanks

  • First commit to issue fork.
  • Status changed to Needs review about 2 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia manish-31

    Not sure why we have opened two MR's we can close MR !4.

    I have updated merge request !6, replaced property_exits() check with isset() to avoid another unnecessary check.

    Needs review. Thanks!

  • ๐Ÿ‡ช๐Ÿ‡ธSpain ady1503

    Hello.

    After update to Versiรณn de Drupal 10.2.6. To many errors apear without add Field Group Layout to content type:

    Warning: include_once(/home/***/public_html/***/web/core/modules/layout_builder/layouts/twocol_section/templates/theme.inc): Failed to open stream: No such file or directory in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(): Failed opening '/home/***/public_html/***/web/core/modules/layout_builder/layouts/twocol_section/templates/theme.inc' for inclusion (include_path='/home/***/public_html/***/vendor/pear/archive_tar:/home/***/public_html/***/vendor/pear/console_getopt:/home/***/public_html/***/vendor/pear/pear-core-minimal/src:/home/***/public_html/***/vendor/pear/pear_exception:.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(/home/***/public_html/***/web/core/modules/layout_builder/layouts/threecol_section/templates/theme.inc): Failed to open stream: No such file or directory in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(): Failed opening '/home/***/public_html/***/web/core/modules/layout_builder/layouts/threecol_section/templates/theme.inc' for inclusion (include_path='/home/***/public_html/***/vendor/pear/archive_tar:/home/***/public_html/***/vendor/pear/console_getopt:/home/***/public_html/***/vendor/pear/pear-core-minimal/src:/home/***/public_html/***/vendor/pear/pear_exception:.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(/home/***/public_html/***/web/core/modules/layout_builder/layouts/fourcol_section/templates/theme.inc): Failed to open stream: No such file or directory in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(): Failed opening '/home/***/public_html/***/web/core/modules/layout_builder/layouts/fourcol_section/templates/theme.inc' for inclusion (include_path='/home/***/public_html/***/vendor/pear/archive_tar:/home/***/public_html/***/vendor/pear/console_getopt:/home/***/public_html/***/vendor/pear/pear-core-minimal/src:/home/***/public_html/***/vendor/pear/pear_exception:.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(/home/***/public_html/***/web/core/modules/layout_discovery/layouts/onecol/templates/theme.inc): Failed to open stream: No such file or directory in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(): Failed opening '/home/***/public_html/***/web/core/modules/layout_discovery/layouts/onecol/templates/theme.inc' for inclusion (include_path='/home/***/public_html/***/vendor/pear/archive_tar:/home/***/public_html/***/vendor/pear/console_getopt:/home/***/public_html/***/vendor/pear/pear-core-minimal/src:/home/***/public_html/***/vendor/pear/pear_exception:.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(/home/***/public_html/***/web/core/modules/layout_discovery/layouts/twocol/templates/theme.inc): Failed to open stream: No such file or directory in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(): Failed opening '/home/***/public_html/***/web/core/modules/layout_discovery/layouts/twocol/templates/theme.inc' for inclusion (include_path='/home/***/public_html/***/vendor/pear/archive_tar:/home/***/public_html/***/vendor/pear/console_getopt:/home/***/public_html/***/vendor/pear/pear-core-minimal/src:/home/***/public_html/***/vendor/pear/pear_exception:.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(/home/***/public_html/***/web/core/modules/layout_discovery/layouts/twocol_bricks/templates/theme.inc): Failed to open stream: No such file or directory in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(): Failed opening '/home/***/public_html/***/web/core/modules/layout_discovery/layouts/twocol_bricks/templates/theme.inc' for inclusion (include_path='/home/***/public_html/***/vendor/pear/archive_tar:/home/***/public_html/***/vendor/pear/console_getopt:/home/***/public_html/***/vendor/pear/pear-core-minimal/src:/home/***/public_html/***/vendor/pear/pear_exception:.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(/home/***/public_html/***/web/core/modules/layout_discovery/layouts/threecol_25_50_25/templates/theme.inc): Failed to open stream: No such file or directory in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(): Failed opening '/home/***/public_html/***/web/core/modules/layout_discovery/layouts/threecol_25_50_25/templates/theme.inc' for inclusion (include_path='/home/***/public_html/***/vendor/pear/archive_tar:/home/***/public_html/***/vendor/pear/console_getopt:/home/***/public_html/***/vendor/pear/pear-core-minimal/src:/home/***/public_html/***/vendor/pear/pear_exception:.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(/home/***/public_html/***/web/core/modules/layout_discovery/layouts/threecol_33_34_33/templates/theme.inc): Failed to open stream: No such file or directory in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(): Failed opening '/home/***/public_html/***/web/core/modules/layout_discovery/layouts/threecol_33_34_33/templates/theme.inc' for inclusion (include_path='/home/***/public_html/***/vendor/pear/archive_tar:/home/***/public_html/***/vendor/pear/console_getopt:/home/***/public_html/***/vendor/pear/pear-core-minimal/src:/home/***/public_html/***/vendor/pear/pear_exception:.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(/home/***/public_html/***/web/modules/contrib/vefl/layouts/onecol/templates/theme.inc): Failed to open stream: No such file or directory in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    Warning: include_once(): Failed opening '/home/***/public_html/***/web/modules/contrib/vefl/layouts/onecol/templates/theme.inc' for inclusion (include_path='/home/***/public_html/***/vendor/pear/archive_tar:/home/***/public_html/***/vendor/pear/console_getopt:/home/***/public_html/***/vendor/pear/pear-core-minimal/src:/home/***/public_html/***/vendor/pear/pear_exception:.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in include_once() (line 515 of core/lib/Drupal/Core/Theme/Registry.php).

    When add to content type:

    Deprecated function: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of core/lib/Drupal/Core/Layout/LayoutPluginManager.php).

    Deprecated function: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of core/lib/Drupal/Core/Layout/LayoutPluginManager.php).

    Deprecated function: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of core/lib/Drupal/Core/Layout/LayoutPluginManager.php).

    Deprecated function: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of core/lib/Drupal/Core/Layout/LayoutPluginManager.php).

    Deprecated function: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in Drupal\Core\Layout\LayoutPluginManager->Drupal\Core\Layout\{closure}() (line 204 of core/lib/Drupal/Core/Layout/LayoutPluginManager.php).

    Warning: Undefined array key "field_layout" in Drupal\field_group_layout\Plugin\field_group\FieldGroupFormatter\LayoutFormatter->settingsForm() (line 81 of modules/contrib/field_group_layout/src/Plugin/field_group/FieldGroupFormatter/LayoutFormatter.php).

    As you can see, it is affecting other modules that "Layout Builder" uses.

    When I uninstall the module "Field Group Layout" there is no errors.

    Thanks

  • Status changed to Needs work about 2 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ดNorway matsbla

    Both MR 4 or MR 6 does not fix the error adressed in this issue.

    Warning: Undefined property: stdClass::$group_name in Drupal\field_group_layout\Plugin\field_group\FieldGroupFormatter\LayoutFormatter->settingsForm() (line 73 of modules/contrib/field_group_layout/src/Plugin/field_group/FieldGroupFormatter/LayoutFormatter.php).

    Warning: Undefined array key "" in Drupal\field_group_layout\Plugin\field_group\FieldGroupFormatter\LayoutFormatter->settingsForm() (line 73 of modules/contrib/field_group_layout/src/Plugin/field_group/FieldGroupFormatter/LayoutFormatter.php).

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    apaderno โ†’ changed the visibility of the branch 3433241-it-works-but to hidden.

  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine vlad.dancer Kyiv
Production build 0.69.0 2024