geerlingguy / drupal-for-kubernetes

Drupal Example Site for Kubernetes
http://www.pidramble.com
GNU General Public License v2.0
164 stars 52 forks source link

Composer install hits errors with scaffold files #33

Open geerlingguy opened 4 years ago

geerlingguy commented 4 years ago

After the Drupal 9 upgrade (see video: https://www.youtube.com/watch?v=nLoJ2L0AzDY), I noticed that when running composer install I'm getting the following:

Class DrupalProject\composer\ScriptHandler is not autoloadable, can not call post-install-cmd script

To get the site upgraded in a 2-hour timespan, I kinda cut a few corners tossing out some old composer.json cruft, and I seem to have broken some of the stuff that the drupal-project/composer-template had originally injected into the Composer config (like the ScriptHandler... might not even be needed anymore?).

davearch commented 4 years ago

Hi, yes I'm pretty sure it is the autoload value in composer.json that causes this. When I put that back in it seemed to work fine.

    "autoload": {
        "classmap": [
            "scripts/composer/ScriptHandler.php"
        ],
        "files": ["load.environment.php"]
    },

Actually load.environment.php gave me an error but I just got rid of it.

I did get another warning about the CONFIG_SYNC_DIRECTORY constant in ScriptHandler.php needing quotation marks too.

[ErrorException]
Use of undefined constant CONFIG_SYNC_DIRECTORY - assumed 'CONFIG_SYNC_DIRECTORY' (this will throw an Error in a future version of PHP)

That being said I don't think you need the ScriptHandler anymore because it creates a settings.php file but then it is immediately overwritten in the Dockerfile

COPY pidramble.settings.php /var/www/html/web/sites/default/settings.php