Warning: Undefined variable $content_types

Created on 7 November 2023, about 1 year ago
Updated 20 January 2024, 11 months ago

Problem/Motivation

There is a potentially undefined variable in the ConditionalMessage entity when no content types exist yet. This can occur for instance when tests are running in a clean drupal environment (without content types).

Steps to reproduce

Run drupal without content types. The following warning will be generated: Undefined variable $content_types ConditionalMessage.php:383. The variable $content_types is set within a foreach loop, which potentially doesn't loop, hence the variable is not created.

Proposed resolution

Set the $content_types variable outside the foreach loop in ConditionalMessage.php:351.

Remaining tasks

Set the $content_types variable outside the foreach loop in ConditionalMessage.php:351.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇪Belgium fernly

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

Comments & Activities

Production build 0.71.5 2024