MenuTreeStorage::getExpanded needs compatible operation for the condition method

Created on 29 August 2023, 10 months ago
Updated 4 October 2023, 9 months ago

After updating core to 10.1 you get a notice for the t.ancestor condition:

Warning: Undefined array key 0 in Drupal\Core\Database\Query\Condition->condition() (line 114 of core/lib/Drupal/Core/Database/Query/Condition.php)

It turns out this is due to a change introduced in 10.1.x: https://www.drupal.org/node/3350985 .

The condition method in the getExpanded method of the storage class needs to be updated because the $parents variable is an array.

->condition('t.ancestor', $parents) should be ->condition('t.ancestor', $parents, 'IN')

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇸🇮Slovenia jzavrl

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

Comments & Activities

Production build 0.69.0 2024