Fix D9.3 test failures - "FilterFormat label is expected to be a string."

Created on 11 November 2021, over 3 years ago
Updated 23 December 2023, over 1 year ago

Problem/Motivation

The core change that caused this failure was #3232673: \Drupal\Core\Entity\EntityInterface::label() can return a NULL , which was committed on 30 Sept 21 (commit 9da1866). That issue added an assert() into the core filter module to ensure that all FilterFormat entities has a label. This was not explicitly checked in prior versions of core.

This code in address module that is causing the error is :

    $this->testFormat = FilterFormat::create([
      'format' => 'test',
      'weight' => 1,
      'filters' => [
        'filter_html_escape' => ['status' => TRUE],
      ],
    ]);

which creates the FilterFormat with an id but no label.
Its missing the 'name' key in the array parameter.

Steps to reproduce

Run CountryNameTokenTest.php in a Drupal 9.3.0-alpha1 environment.

Proposed resolution

Add name key to array.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇷Brazil paulocs Belo Horizonte

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024