Issue
After updating to Drush 9/10, the default file system paths may no longer be correct for a newly created site in Site Factory. In this situation, if a new site is created, all media items will not rendering in the new site which was created after the Drush update.
The pre Drush update default file system path for all media items would like something like:
/var/www/html/<site-factory-hosting-name>.<environment>/docroot/sites/g/files/<siteid>/files
For the newly created site after the Drush update the default file system path may look like:
/var/www/html/<site-factory-hosting-name>.<environment>/docroot/sites/g/files
Resolution
In order to resolve this, please add a site factory hook in the factory-hooks/pre-settings-php
directory. Create a file in this directory, such as files_path.php
, and in this file place the following code:
$settings['file_public_path'] = "sites/g/files/{$GLOBALS['gardens_site_settings' ]['conf']['acsf_db_name']}/files";
$settings['file_private_path'] = "/mnt/files/{$_ENV['AH_SITE_GROUP']}.{$_ENV['AH _SITE_ENVIRONMENT']}/sites/g/files-private/{$GLOBALS['gardens_site_settings']['conf']['acsf_db_name']}";