Problem/Motivation
After upgrading our site to D10.1 we got an error when trying to open the Simple Live CSS tray:
TypeError: Drupal\simple_live_css\Controller\LiveCssController::__construct(): Argument #2 ($css_collection_optimizer) must be of type Drupal\Core\Asset\CssCollectionOptimizer, Drupal\Core\Asset\CssCollectionOptimizerLazy given, called in /var/www/werkgevers/web/modules/contrib/simple_live_css/src/Controller/LiveCssController.php on line 67 in Drupal\simple_live_css\Controller\LiveCssController->__construct() (regel 54 van /var/www/werkgevers/web/modules/contrib/simple_live_css/src/Controller/LiveCssController.php).
2 services seem to use a different class now and the type validation fails:
asset.css.collection_optimizer uses CssCollectionOptimizerLazy now, and
asset.js.collection_optimizer uses JsCollectionOptimizerLazy now.
Proposed resolution
Change the types of the constructor arguments tot the ..Lazy classes.
Issue fork simple_live_css-3381835
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
Comment #3
wannesdrUpdated the fork by using the
AssetCollectionOptimizerInterfaceso it stays backwards compatible.I tested the change with core version 9.5, 10.0.8 and 10.1.
Comment #4
wannesdrComment #6
jhandsta commentedTested this as well, the changes in the issue fork fix the regression while staying backwards compatible.
Committed, thanks @wannesdr!
Comment #7
jhandsta commentedI made a new tag for this one, since it completely broke the module in D10.1.
Closing this issue.