Problem/Motivation

With PHP 8.2:

Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Unicode::validateUtf8() (line 395 of core/lib/Drupal/Component/Utility/Unicode.php).
Drupal\Component\Utility\Unicode::validateUtf8(NULL) (Line: 65)
Drupal\Component\Utility\Xss::filter(NULL) (Line: 826)
bootstrap_barrio_preprocess_input(Array, 'input', Array)
call_user_func_array('bootstrap_barrio_preprocess_input', Array) (Line: 285)

Proposed resolution

In bootstrap_barrio.theme:

826: $variables['safe_value_label'] = Xss::filter($variables['attributes']['value']); -> $variables['safe_value_label'] = Xss::filter($variables['attributes']['value'] ?? '');

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

tonibarbera created an issue. See original summary.

sarwan_verma made their first commit to this issue’s fork.

tonibarbera’s picture

Issue summary: View changes
sarwan_verma’s picture

Assigned: tonibarbera » Unassigned
Status: Active » Needs review

Hi, this issue was reproduced in my local. I have created the MR. Please review.

tonibarbera’s picture

Assigned: Unassigned » tonibarbera

The solution provided by the user sarwan_verma is not correct. Is not fixing the reported problem in this ticket and it modified lines that are not related to this ticket at all.

The detected problem by him can be considered an error too and I will fix it in this issue, but, without modifying line 889.

I'm providing a correct fix.

tonibarbera’s picture

Status: Needs review » Active
tonibarbera’s picture

This patch works with bootstrap_barrio 5.5.14

tonibarbera’s picture

Status: Active » Needs review

akalam made their first commit to this issue’s fork.

akalam’s picture

The MR is correct because the $hex variable is a string so should use "." to concat. I fixed a wrong format with the if closing bracket.

tonibarbera’s picture

Ok, then I've updated the MR with this ticket fix and I'm providing a new patch version.

tonibarbera’s picture

StatusFileSize
new1.13 KB

This patch includes the current MR changes. Tested in Drupal 10.1.5 and bootstrap_barrio 5.5.14

  • hatuhay committed 7270f85c on 5.5.x authored by tonibarbera
    Issue #3394923 by tonibarbera: With PHP 8.2: Deprecated function: strlen...
hatuhay’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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