I'm upgrading a quite basic project from 4.0.1 to 4.1.0. This is the result after the first try:
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 28 updates, 0 removals
- Updating silverstripe/vendor-plugin (1.2.0 => 1.3.1): Downloading (100%)
- Updating symfony/yaml (v3.4.3 => v3.4.6): Downloading (100%)
- Updating symfony/polyfill-mbstring (v1.6.0 => v1.7.0): Downloading (100%)
- Updating symfony/translation (v2.8.33 => v2.8.36): Downloading (100%)
- Updating symfony/filesystem (v3.4.3 => v3.4.6): Downloading (100%)
- Updating symfony/config (v3.4.3 => v3.4.6): Downloading (100%)
- Updating symfony/polyfill-apcu (v1.6.0 => v1.7.0): Downloading (100%)
- Updating psr/simple-cache (1.0.0 => 1.0.1): Downloading (100%)
- Updating symfony/cache (v3.4.3 => v3.4.6): Downloading (100%)
- Updating swiftmailer/swiftmailer (v5.4.8 => v5.4.9): Downloading (100%)
- Updating symfony/finder (v3.4.3 => v3.4.6): Downloading (100%)
- Updating silverstripe/config (1.0.1 => 1.0.4): Downloading (100%)
- Updating silverstripe/framework (4.0.1 => 4.1.0): Downloading (100%)
PHP Fatal error: Undefined class constant 'MODULE_FILTER' in .../vendor/silverstripe/vendor-plugin/src/Library.php on line 230
Fatal error: Undefined class constant 'MODULE_FILTER' in .../vendor/silverstripe/vendor-plugin/src/Library.php on line 230
I searched through the upgrading guide but found nothing relevant. A second try solved the issue:
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 16 updates, 0 removals
- Updating silverstripe/framework (4.0.1 => 4.1.0): Loading from cache
Exposing web directories for silverstripe-vendormodule silverstripe/framework with method auto:
- client/images
- client/styles
- src/Dev/Install/client
- Updating silverstripe/assets (1.0.1 => 1.1.0): Downloading (100%)
- Updating nikic/php-parser (v3.1.3 => v3.1.5): Downloading (100%)
- Updating league/flysystem (1.0.41 => 1.0.43): Downloading (100%)
- Updating embed/embed (v3.2.2 => v3.3.1): Downloading (100%)
- Updating silverstripe/versioned (1.0.1 => 1.1.0): Downloading (100%)
- Updating silverstripe/admin (1.0.1 => 1.1.0): Downloading (100%)
Exposing web directories for silverstripe-vendormodule silverstripe/admin with method auto:
- client/dist
- client/lang
- thirdparty
- Updating silverstripe/siteconfig (4.0.1 => 4.1.0): Downloading (100%)
- Updating silverstripe/reports (4.0.1 => 4.1.0): Downloading (100%)
Exposing web directories for silverstripe-vendormodule silverstripe/reports with method auto:
- javascript
- Updating silverstripe/campaign-admin (1.0.1 => 1.1.0): Downloading (100%)
Exposing web directories for silverstripe-vendormodule silverstripe/campaign-admin with method auto:
- client/dist
- client/lang
- Updating silverstripe/graphql (1.0.1 => 1.1.0): Downloading (100%)
- Updating silverstripe/asset-admin (1.0.1 => 1.1.0): Downloading (100%)
Exposing web directories for silverstripe-vendormodule silverstripe/asset-admin with method auto:
- client/dist
- client/lang
- Updating silverstripe/cms (4.0.1 => 4.1.0): Downloading (100%)
Exposing web directories for silverstripe-vendormodule silverstripe/cms with method auto:
- client/dist
- client/lang
- Updating silverstripe/errorpage (1.0.1 => 1.1.0): Downloading (100%)
- Updating undefinedoffset/sortablegridfield (2.0.2 => 2.0.4): Downloading (100%)
Exposing web directories for silverstripe-vendormodule undefinedoffset/sortablegridfield with method auto:
- css
- javascript
- Updating axllent/silverstripe-enquiry-page (2.1.0 => 2.1.1): Downloading (100%)
Exposing web directories for silverstripe-vendormodule axllent/silverstripe-enquiry-page with method auto:
- images
- javascript
Writing lock file
Generating autoload files
Yeah it鈥檚 a side effect of SS 4.1 needing new functionality in a dependency that gets updated at the same time, so it鈥檚 not available to use on the first attempt (hence why it works the second time).
Would it be better if we say in the upgrade guide to update the recipe plugin first, then update everything else?
Would it be better if we say in the upgrade guide to update the recipe plugin first, then update everything else?
It would have certainly helped me :wink:
It's a weird bug in the module, where loading classes doesn't seem to work properly if the module itself in question is being updated. I wonder if we should shiv in an autoloader? Just re-running the install a second time is all I can recommend at the moment I'm sorry.
Fixed with https://github.com/silverstripe/vendor-plugin/pull/18
We don't really need the filter at all, so let's remove it. It also caused an issue with root composer.json, so this'll resolve that also.
@robbieaverill Can you PR please?
Would you like a docs PR as well as silverstripe/vendor-plugin#18 @chillu?
Haven't read through the issue, your call.
Fixed by https://github.com/silverstripe/vendor-plugin/pull/18 (tagged as 1.3.2) and docs for users of previous vendor-plugins versions are updated in https://github.com/silverstripe/silverstripe-framework/pull/7953
Most helpful comment
It would have certainly helped me :wink: