Error if no entity types are selected

Created on 14 December 2023, about 1 year ago
Updated 22 February 2024, 10 months ago

It's not possible to add some fields description. The page returns error 500 if no entity types are selected in configuration.
/admin/structure/manage-flexible-descriptions

Message	TypeError: Drupal\Core\Render\Element::children(): Argument #1 ($elements) must be of type array, null given, called in /var/www/html/web/modules/contrib/flexible_descriptions/src/Form/FlexibleDescriptionsManagementForm.php on line 166 in Drupal\Core\Render\Element::children() (line 72 of /var/www/html/web/core/lib/Drupal/Core/Render/Element.php).
🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇱Israel heyyo Jerusalem

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

Merge Requests

Comments & Activities

  • Issue created by @heyyo
  • First commit to issue fork.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India viren18febS

    I have resolved the issue & added patch, please review.

  • Status changed to Needs work about 1 year ago
  • 🇺🇦Ukraine quadrexdev Lutsk

    Thanks, that sounds reasonable.

    Just two points to finish this issue:

    1. Please create a merge request using forks.
    2. Let's combine if checks within one statement:

    Before:

     if(!empty($form[$entity_type_id])){
                     if (empty(Element::children($form[$entity_type_id]))) {
                         unset($form[$entity_type_id]);
                 }
    

    After:

     if(!empty($form[$entity_type_id]) && empty(Element::children($form[$entity_type_id]))) {
                       unset($form[$entity_type_id]);
                 }
    
  • Merge request !14issue-3408782-error-if-no-fixes. → (Merged) created by viren18febS
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India viren18febS

    @quadrexdev, I have update the above solution & generated the MR, please review.

  • Status changed to Fixed 11 months ago
  • 🇺🇦Ukraine quadrexdev Lutsk

    Merged, thanks!

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

Production build 0.71.5 2024