Failed to open "contentblocks/vendor/autoload.php"

Hi everyone,

after moving the website to other machine i’m getting the error 500 if i want to edit a resource.

In error logs is a warning "components/contentblocks/vendor/autoload.php): failed to open stream: No such file or directory"

If i adjust path in "components/contentblocks/model/contentblocks/contentblocks.class.php"

on line 2: require_once dirname(dirname(DIR)) . ‘/vendor/autoload.php’;

to absolute path “components/contentblocks/model/vendor/autoload.php” everything works fine.

I’v tried also to reinstall the plugin. But get the same errors. Also i tried to update it with composer “https://support.modmore.com/article/222-autoloading-conflict

This happens on Windows and Mac with PHP 7.3.24

Any Ideas?

Thanks for help.

ContentBlocks v1.9 moved up the vendor directory from core/components/contentblocks/model/ to core/components/contentblocks/ to be more in line with our other extras.

It sounds like that somehow didn’t go right with your site move. Try reinstalling ContentBlocks from the package manager (“reinstall” button - no need to uninstall and install separately) to make sure the files are in the right location.

If the reinstall doesn’t work because the package wasn’t moved in the server transfer, or due to a license issue, (force) remove the last package version and download the latest version as an update. Some of your settings may get reset to the default that way, so taking a backup would not be a bad idea before doing that.

After adjusting the path i could delete the plugin with errors. After reinstall seems now working.

The path now is “require_once dirname(dirname(DIR)) . ‘/vendor/autoload.php’;”

Thank you!

1 Like

Same issue here - transferring from local to dev server causes CB not working anymore. Reinstalling did not work because of a license issue - even i have a unlimited license. What did the trick for me was to delete the current Package-Version in the Database and running the Update via Package-Manager.

Even with an unlimited license, the specific downloaded package still has a license key embedded that belongs to a specific domain, so that’s why that can still fail with an unlimited license. Each time you download on a new domain, rather than a pesky error or email about not being licensed to do so, it magically creates a new license key right away. :sparkles:

I do find it very curious multiple people are running into this after a server transfer… one case points to gremlins, but 2 distinct cases within 20 days of the release seems too much of a coincidence and suggests more cases may be coming.

If you don’t mind, I’d love to hear from both of you @jdaehne @eiwanow how that server transfer was done - did you copy the exact files as they were on the old server, including core/components, to the new server, or was a different process used?

I always do the transfer via git/github. So it is a copy of every file from local.

Same by me. Via Git/Github.

Gotcha, git does have a copy of every file… Except the vendor directory which is ignored by the .gitignore also in ContentBlocks. Mystery solved, I think! :wink:

Perhaps you’ve previously added the old vendor directory by force, or did a production reinstall to get those in place, but when the CB update moved it that was not reflected in your repository and did not get deployed.

Just as a heads up, a similar change where the vendor directory is moved up is happening in MoreGallery 1.11.3, so keep an eye on that with your workflow.