0

I'm going to try to be as thorough as possible. I have an AcquiaCloud-hosted Drupal site with 3 environments, dev, staging, and production. My team uses Acquia DevDesktop to work on this site.

The original developers setup the site to move the /vendor directory out of /docroot. I believe they also used a module (Drupal-Composer or Drupal Scaffold, maybe?) that claims to have assembled the site in /web but we do not have that directory in our repo, we have /docroot as per usual. Anyway, the /vendor directory now lives in both the repo root and another /vendor directory is in the /docroot directory.

This problem was raised here but no one provided any feedback.

I am getting errors such as the following:

OneLogin Saml_Auth class not found

Similarly, when I attempt to use various functions on the site that depend on a library or some dependency, I receive errors. For example, PHPMailer classes are not being loaded:

phpmailer class not found

My project directory has a /vendor folder in the root with an autoload.php pointing to the 3-4 autoload files that composer generates:

autoload vendor directory two in project

and then here: vendor directory in docroot

I get the dreaded WSOD when attempting to use things like Saml_Auth or form mailers. Otherwise, the site "works" in the sense that I can navigate around in content, load the admin panel, make minor configuration changes, etc. Only when a library or dependency is needed, it seems to break. This leads me to believe that dependencies from repo_root/vendor or /repo_root/docroot/vendor are not being loaded properly.

Misc./errata: Core 8.5.2, Drush 9, Composer, behat, circle ci, phing/ansible builds are no longer being used but their configs persist in the repo. Just ignore those files in the photos.

Does anyone have any idea how I can triage this situation and my dev environments working again?

Thanks a million.

  • If you have been orchestrating the site with composer, you should be able to use that file to create a new project from it, and supply the database, and you should be fine. Since you are on Acquia I would strongly advise to use BLT over Drupal Composer project. I don't think this change is as simple as moving the directory out without some other changes as well. – Kevin Apr 24 '18 at 18:29
  • The autoload.php file should be pointing one level out. For instance, the core one usually looks in the same directory, but you probably want it to look one level back: return require __DIR__ . '/../vendor/autoload.php'; – Kevin Apr 24 '18 at 18:33
  • @Kevin Thanks! Just to be clear, I would point the autoload.php in /docroot/vendor to the directory repo_root/vendor/ ? – Jordan J. Apr 24 '18 at 18:40
  • It should just be one level up. Which is achieved by using '/../vendor, if that is where you moved it to. – Kevin Apr 24 '18 at 18:42
  • @Kevin I believe this has fixed the issue! Am I wrong to assume that I can safely delete the /docroot/vendor directory from the repo? – Jordan J. Apr 24 '18 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.