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'] ?? '');
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 3394923-with-php-8.2.patch | 1.13 KB | tonibarbera |
Issue fork bootstrap_barrio-3394923
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:
- 3394923-with-php-8.2
changes, plain diff MR !67
Comments
Comment #4
tonibarbera commentedComment #5
sarwan_verma commentedHi, this issue was reproduced in my local. I have created the MR. Please review.
Comment #6
tonibarbera commentedThe 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.
Comment #7
tonibarbera commentedComment #8
tonibarbera commentedThis patch works with bootstrap_barrio 5.5.14
Comment #9
tonibarbera commentedComment #11
akalam commentedThe 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.
Comment #12
tonibarbera commentedOk, then I've updated the MR with this ticket fix and I'm providing a new patch version.
Comment #13
tonibarbera commentedThis patch includes the current MR changes. Tested in Drupal 10.1.5 and bootstrap_barrio 5.5.14
Comment #15
hatuhay commented