Problem/Motivation

On first deploy, filecache coughs because the settings.php is in place, but the module not enabled.

Steps to reproduce

Proposed resolution

Add a composer.json w/ psr-4 autoload.

This approach was taken from #3330477: Make igbinary usable without needing module enabled..

Remaining tasks

- Create a MR

User interface changes

API changes

Data model changes

Issue fork filecache-3367497

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

SocialNicheGuru created an issue. See original summary.

holo96’s picture

Seems like this worked for me (settings.php):

    if (!InstallerKernel::installationAttempted()) {
      $settings['filecache']['directory']['default'] = '../filecache';
      $class_loader->addPsr4('Drupal\\filecache\\', 'modules/contrib/filecache/src');
      $settings['container_yamls'][] = 'modules/contrib/filecache/filecache.services.yml';
      $settings['cache']['default'] = 'cache.backend.file_system';
    }

I will test little bit more to see if I run into any other issues.
I think this is essential for first time deploy...

geek-merlin’s picture

Category: Feature request » Task
Priority: Normal » Major

We ran into this too on first deploy, it's a big PITA. Thx for the workaround.
Setting major task for this.

geek-merlin’s picture

Title: Make filecache usable without needing module enabled. » Stop filecache coughing on first deploy, by adding psr4 spec
Issue summary: View changes
Issue tags: +Novice

gurnoor kaur made their first commit to this issue’s fork.

gurnoor kaur’s picture

Status: Active » Needs review
geek-merlin’s picture

Status: Needs review » Reviewed & tested by the community

MR LGTM, tests are green.

geek-merlin’s picture

Issue tags: -Novice
pfrenssen’s picture

Title: Stop filecache coughing on first deploy, by adding psr4 spec » Make sure filecache works on initial deploy
Category: Task » Bug report

pfrenssen’s picture

Status: Reviewed & tested by the community » Fixed

Thanks very much for the report and the fix!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pfrenssen’s picture

Issue tags: +DevDaysAthens2026

Status: Fixed » Closed (fixed)

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