Changing field group layout causes error

Created on 8 October 2023, about 1 year ago
Updated 9 August 2024, 3 months ago

I first save a field group with one column, and then tried to update it to two columns, and once I click save I get this error:

TypeError: Argument 2 passed to field_group_formatter_row_update() must be of the type array, null given, called in /var/lib/tugboat/stm/web/modules/contrib/field_group/includes/field_ui.inc on line 163 in field_group_formatter_row_update() (line 555 of /var/lib/tugboat/stm/web/modules/contrib/field_group/includes/field_ui.inc)

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ณ๐Ÿ‡ดNorway matsbla

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

Merge Requests

Comments & Activities

  • Issue created by @matsbla
  • Assigned to Shreya_98
  • Issue was unassigned.
  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ravi kant Jaipur

    I got different errors.
    Error

    Message	TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in array_key_exists() (line 133 of /app/web/modules/contrib/field_group_layout/src/Plugin/field_group/FieldGroupFormatter/LayoutFormatter.php)
    #0 /app/web/modules/contrib/field_group_layout/src/Plugin/field_group/FieldGroupFormatter/LayoutFormatter.php(133): array_key_exists('group_media_top', NULL)
    #1 /app/web/modules/contrib/field_group/includes/field_ui.inc(607): Drupal\field_group_layout\Plugin\field_group\FieldGroupFormatter\LayoutFormatter->settingsSummary()
    #2 /app/web/modules/contrib/field_group/includes/field_ui.inc(292): field_group_format_settings_summary('group_media', Object(stdClass))
    #3 /app/web/modules/contrib/field_group/field_group.module(208): field_group_field_ui_display_form_alter(Array, Object(Drupal\Core\Form\FormState))
    

    Warnnings

    Warning: Undefined array key "#wrapper_element" in template_preprocess_field_group__layout_onecol() (line 55 of /app/web/modules/contrib/field_group_layout/templates/theme.inc)
    #0 /app/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'Undefined array...', '/app/web/module...', 55)
    #1 /app/web/modules/contrib/field_group_layout/templates/theme.inc(55): _drupal_error_handler(2, 'Undefined array...', '/app/web/module...', 55)
    #2 [internal function]: template_preprocess_field_group__layout_onecol(Array, 'field_group_lay...', Array)
    #3 /app/web/core/lib/Drupal/Core/Theme/ThemeManager.php(287): call_user_func_array('template_prepro...', Array)
    #4 /app/web/core/lib/Drupal/Core/Render/Renderer.php(489): Drupal\Core\Theme\ThemeManager->render('field_group_lay...', Array)
    #5 /app/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender(Array)
    #6 /app/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false)
    #7 /app/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render(Array)
    #8 /app/web/sites/default/files/php/twig/6527f01c6a0ae_node-edit-form.html.twig_bSkfhA7iECKzrYmbu68NthZFI/Q2xOv2rFAFIYYIx0W
    
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aman1248

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

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

    "Hello @Valentine94 and @RaviKant I've created a merge request to address the previously mentioned issue. The solution has been implemented, and now the functionality is working smoothly." Please Review.

  • Status changed to Needs review 7 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aman1248

    Hy @Valentine94 ,
    I Have Raised The Merge Request ,Please Review Once.
    Thankyou

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

    I tested the patch, but the group layout is not changed, and I get some new errors:

    Warning: Attempt to read property "format_type" on null in field_group_field_ui_display_form_alter() (line 350 of /var/lib/tugboat/stm/web/modules/contrib/field_group/includes/field_ui.inc)

    Warning: Undefined variable $new_group1 in Drupal\field_group_layout\Plugin\field_group\FieldGroupFormatter\LayoutFormatter->settingsSummary() (line 153 of /var/lib/tugboat/stm/web/modules/contrib/field_group_layout/src/Plugin/field_group/FieldGroupFormatter/LayoutFormatter.php)

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aman1248

    Hy @matsbla ,please have a look at the merge request 5 created and working for the above issue
    Thanks

  • ๐Ÿ‡ณ๐Ÿ‡ดNorway matsbla

    Yes, that is the one I tested:
    https://git.drupalcode.org/project/field_group_layout/-/merge_requests/5.diff

    And it gives the new errors.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aman1248
  • Status changed to Needs review 7 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aman1248

    hy @matsbla. This change fixes the error showed in the screenshot and also sorts out the issues you had before. Now, you can move field groups from one column to another without any trouble. It makes everything smoother and easier to use. please review

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

    The error mentioned in #10 is still there. In addition when you click update the whole website encountered an unexpected error:

    Error: Attempt to assign property "label" on null in field_group_field_overview_submit() (line 478 of modules/contrib/field_group/includes/field_ui.inc).

  • Status changed to Fixed 4 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ดNorway matsbla

    Please upgrade to 2.0.0-alpha1, this should be fixed now.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024