Problem/Motivation

CssCollectionOptimizerLazy and JsCollectionOptimizerLazy both call methods on an inherited state member variable that has been removed.

Steps to reproduce

Install Drupal 10.2.2 with Flysystem 2.2.x (I used commit b80a666 at the time of replicating the issue) and flysystem_s3 2.1.1. Attempting to rebuild cache through drush results in the error

Undefined property: Drupal\flysystem\Asset\CssCollectionOptimizerLazy::$state CssCollectionOptimizerLazy.php:19

If the usage of state at that line is removed and drush cr is run again, then a similar error is raised.

Fatal error: Uncaught Error: Call to a member function delete() on null in /var/www/html/docroot/modules/contrib/flysystem/src/Asset/JsCollectionOptimizerLazy.php:19

Proposed resolution

Remove the references to state in these classes.

Remaining tasks

All the things.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork flysystem-3415603

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

Eli-T created an issue. See original summary.

eli-t’s picture

Issue summary: View changes

eli-t’s picture

Status: Active » Needs review
bbombachini’s picture

I was having the same problem and your patch resolved.

luigisa’s picture

I was having the same problem and your patch resolved.

eli-t’s picture

One thing to consider here is if the code the MR removes is still required in < 10.2, and whether we should check versions or actually enforce > 10.2 in the next releases composer.json. I'd be interested in what the module maintainers opinions are there.

gold’s picture

I just hit this on an upgrade from 10.1 to 10.2 and the patch of MR46 resolved this for me.

I would consider this RTBC but agree with @Eli-T on the unknown consequences for those still on 10.1 so won't update the Status.

mikeyburnthebook’s picture

I just hit this issue on an upgrade from 10.0 to 10.2 and the patch in MR-46 resolved the issue for me. Would love to see this merged so we don't have to patch. Thanks!

kalpaitch’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

I have tested this with a migration from 10.1 to 10.2.

This is a non-breaking change, thanks for @Eli-T for adding the note of cation, but 10.2 will not use the state for caching the asset filename see this comment from #3301573: Remove the aggregate stale file threshold and state entry:

The asset filename with the new system is cheaper to recreate, so we don't really need this extra level of i/o caching there at all.

Good to merge, have upgraded to major because flysystem will not work with 10.2 without it.

  • lhridley committed 80080c08 on 2.2.x authored by Eli-T
    Issue #3415603 by Eli-T, luigisa, bbombachini, Gold, mikeyburnthebook,...
lisa.rae’s picture

lisa.rae’s picture

Status: Reviewed & tested by the community » Fixed

  • lhridley committed 73621123 on 2.2.x
    Issue #3415603 (2) Updating requirements to require a minimum of Drupal...

Status: Fixed » Closed (fixed)

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