Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293522

header array empty in theme.inc TypeError: strlen(): Argument must be of type string, array given in Unicode.php

$
0
0

Problem/Motivation

TypeError: strlen(): Argument #1 ($string) must be of type string, array given in strlen() (line 395 of core/lib/Drupal/Component/Utility/Unicode.php)

The problem is in template_preprocess_field_multiple_value_form() where there is an empty array in the header.

$header = [
      [
        'data' => [
          '#type' => 'html_tag',
          '#tag' => 'h4',
          '#value' => $element['#title'],
          '#attributes' => $header_attributes,
        ],
        'colspan' => 2,
        'class' => ['field-label'],
      ],
      [], // Problem is here.
      t('Order', [], ['context' => 'Sort order']),
    ];

Steps to reproduce

To be added

Proposed resolution

Remove the cell and increase the colspan of the previous cell.

https://git.drupalcode.org/project/drupal/-/merge_requests/6323

Remaining tasks

Add test coverage

User interface changes

Removal of empty header cell.

API changes

None.

Data model changes

None.

Release notes snippet

TBD


Viewing all articles
Browse latest Browse all 293522

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>