Closed (fixed)
Project:
Layout Builder Component Attributes
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Jan 2026 at 09:17 UTC
Updated:
6 Jul 2026 at 14:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dhruv.mittal commentedComment #3
dhruv.mittal commentedI think if this is the issue of library then it should be fix in the library it self not the module.
Comment #4
kaszarobertAnd yes, it is fixed in the library, but since the module's composer.json requires versions
"^2.0|^3.0", the latest php-css-lint 7.0.0 cannot be installed.Comment #5
chris burge commentedThe issue is with the third-party library.
Symfony dependencies were added to neilime/php-css-lint beginning in v5.0.0 as dev dependencies, and there are compatibility issues with Drupal core as a result. For example, v5.0.0 requires
^6.4of several Symfony libraries. This makes it compatible with Drupal 10 but not Drupal 11, which require Symfony 7. This is also true of v7.0.0.I think the next step here is to file an issue with neilime/php-css-lint requesting support for Symfony 7 in its dev dependencies.
This is also an issue for Laravel (https://packagist.org/packages/laravel/framework#v12.46.0).
Comment #6
chris burge commentedIssue filed: https://github.com/neilime/php-css-lint/issues/183.
Moving to postponed, pending upstream fix.
Comment #8
chris burge commentedneilime/php-css-lintreleased 7.1.0 with support for Symfony 7.2.In v2 and v3,
CssLint\Linter::lintString()returnstruefor a valid CSS string andfalseotherwise. In v7, it returns aGeneratorobject with any errors.v7 is also failing to catch invalid CSS in some of my quick testing:
color: blue font-weight:boldv2 fails validation but v7 passes validation.
Before investing additional time into this, we probably need to decide if CSS validation for the style element is actually providing value.
Comment #9
kaszarobertPerhaps for class validity checks Drupal's built-in \Drupal\Component\Utility\Html::getClass() or \Drupal\Component\Utility\Html::cleanCssIdentifier() functions would be enough. What do you think?
Comment #10
kaszarobertOh, I was wrong. It seems Html::cleanCssIdentifier($value) is already used for checking CSS classes. The php-css-lint library is used for inline CSS style checking.
Comment #11
tobiasbFor people who need now a patch for
neilime/php-css-lint.Comment #12
tobiasbComment #13
clemorphyI think this issue should be prioritized because it kinda breaks the contribution workflow with the ajax response marked as failed, even if it saves the data.
PHP 8.4 is 1.5 years old now, so it's quite common.
Comment #16
pfructuoso commentedThis patch fixes the PHP 8.4 compatibility issue within the module itself, without requiring patches on the upstream library.
Approach: Instead of patching
neilime/php-css-lintv3.2.0 (as proposed in #11), this updates the module's composer constraint to^2.0|^3.0|^7.0and adapts the code to handle both APIs:lintString()returnsboollintString()returnsGenerator<LintError>(empty generator = valid CSS)Composer will automatically resolve the correct version based on the PHP environment:
Note: Symfony is only a dev dependency of
neilime/php-css-lintv7.x, so there are no conflicts with either Drupal 10 (Symfony 6) or Drupal 11 (Symfony 7).ludwig.jsonhas also been updated from v3.1.3 to v7.2.0 for sites not using Composer.Additionally, the implicit nullable parameter
$section_storage = NULLinbuildForm()has been corrected to?SectionStorageInterface $section_storage = NULL, fixing a pre-existing PHP 8.4 deprecation in the same file.Comment #21
chris burge commentedComment #23
clemorphyPerfect, thanks guys !