User error: "inform_message" & "menu_not_selected" is an invalid render array key

Created on 12 January 2024, 10 months ago
Updated 15 January 2024, 10 months ago

Problem/Motivation

When viewing the Camp page, the following error messages are displayed:

User error: "inform_message" is an invalid render array key in Drupal\Core\Render\Element::children() (line 98 of /var/www/docroot/core/lib/Drupal/Core/Render/Element.php)
User error: "menu_not_selected" is an invalid render array key in Drupal\Core\Render\Element::children() (line 98 of /var/www/docroot/core/lib/Drupal/Core/Render/Element.php)

This is due to the fact that we save 'inform_message' & 'menu_not_selected' into the $variables['content'].

Steps to reproduce

  1. Install latest OpenY profile.
  2. Create a Camp node and check "Use Layout Builder" checkbox.
  3. Observe the errors in the Recent log messages on in the messages area above the content.

Proposed resolution

Save 'menu_not_selected' & 'inform_message' to $variables array directly, instead of $variables['content'], since $variables['content'] is then passed through Drupal Render methods.

Remaining tasks

To test if there's any regressions.

User interface changes

No changes.

API changes

No changes.

Data model changes

No changes.

πŸ› Bug report
Status

Needs review

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine Sardis

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024