Problem/Motivation

With Drupal 10, with taxonomy lookup, a Markup object is being passed instead of string to the entity condition which in terms leads to an array instead of a string at query execution. Resulting in:
mb_strtolower(): Argument #1 ($string) must be of type string, array given in mb_strtolower() (line 36 of /app/web/core/lib/Drupal/Core/Config/Entity/Query/Condition.php).

Steps to reproduce

- With Drupal 10, use a taxonomy lookup setup.

Proposed resolution

Enforce passing a string to the taxonomy instead of a string like object.

Issue fork exif-3324007

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

NickDickinsonWilde created an issue. See original summary.

nickdickinsonwilde’s picture

Assigned: nickdickinsonwilde » Unassigned
Status: Needs work » Needs review

nickdickinsonwilde’s picture

Status: Needs review » Fixed

Hate committing things with no functional tests of the save process. Definitely need to prioritize #3273778: Add test coverage.
But tested on one site for months and we do need a stable release rather than dev.

damienmckenna’s picture

Status: Fixed » Closed (fixed)

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

dewancodes’s picture

BEFORE:
$terms = taxonomy_term_load_multiple_by_name($item, 'tags');

AFTER:

$terms = \Drupal::entityTypeManager()->getStorage("taxonomy_vocabulary")->loadByProperties(["name" => (string)$item, "vid" => 'tags']);

(string) this is the string enforcement.

This worked for me.