Autoloading conflict (Commerce modules not showing, fatal errors)

Since roughly the summer/fall of 2020, we saw a steady increase of reports of an autoloading conflict when using our extras. This would show itself as a problem loading certain classes, causing fatal errors or Commerce modules to not show up in the list after installation. It mostly happened after installing or updating an extra, and would also often seem to cause FormIt-related errors.

With some outside help (thank you Arjen!), we finally identified the root cause in January 2021 as an issue in our build workflow. Contrary to the expected configuration, a recent server migration and some changes in the build workflow inadvertently caused our package provider to create the autoloaders with a very old version of Composer, which would conflict if extras built with newer versions were also present but the old autoloader version was ran first.

On January 20th 2021 we resolved the issue in our build workflow, and applied the fix to versions available for download at that time. 

Extras downloaded from modmore.com on or after January 21st 2021 have been corrected, even if the installed version was released before that dat


If...

  • you're experiencing classes being not found despite being in place and readable (e.g. Sterc\FormIt, Alpacka), or a Commerce module does not show up in the modules list after installation
  • and you have (modmore) extras that were installed before January 21st, 2021

... then you may still experience this issue.

To resolve it, go through the packages in your package manager and update any extra that has updates available. Especially Commerce and FormIt, but any of our extras may be affected. 

For any extra that was installed before January 21st, 2021, but for which no update is available, you have two options.

Solution 1: re-download the package

In order to re-download the package, you'll need to remove the extra in the package manager (just the last installed version is fine), and then update/download it again from our package provider.

Note that this process will reset system settings and other elements to their default values and is not recommended on production environments. It's worthwhile taking note of any changes you made, and to take a backup of your database first. 

Solution 2: update the autoloader manually

This option is less invasive, and can be safely executed on production environments, but you do need SSH access and comfortable with the command line.

  1. Start by SSHing into your server and installing Composer if it's not already pre-installed. With the command composer --version, make sure you're running v1.10+, or update with composer self-update. 
  2. For each extra with an autoloader or dependencies (recognizable by a composer.json file, typically incore/components/name-of-package/ or core/components/name-of-package/model/), run the following command in the same directory as their composer.json file: composer install --optimize-autoloader --no-dev --prefer-dist --no-progress
  3. Repeat for other extras. In particular we recommend running this for Commerce, Commerce extensions, and FormIt v4.2.5 or below.

If you don't have composer installed globally or are using a phar, adjust the composer commands accordingly.

Still need help? Send us an email Send us an email