| Apply module migrations when the Modules folder is outside the app folder module:migrate hands the module's migrations folder to the migrate command after removing base_path() from it. Module::getPath() is a realpath(), so on installations where the Modules folder is a symlink leading outside of the application folder (a common container layout: /var/www/html/Modules -> /data/Modules) base_path() does not occur in that path. The value stays absolute, migrate prepends base_path() to it anyway (BaseCommand:: getMigrationPaths()), the resulting folder does not exist, and the migration reports "Nothing to migrate" with exit code 0. Updating a module through the Modules page then leaves the old schema in place, because Module::updateModule() relies on freescout:module-install and nothing reports the failure. Activating a module is not affected, as ModulesController runs a plain migrate afterwards. Modules now remember the path they have been scanned from, which still contains the symlink and is therefore relative to base_path(), and the module:migrate command builds the --path option from it. The scanned path also travels through the modules cache, as Collection::toArray() keeps the resolved path only. When neither path is inside the application folder the command reports it instead of reporting success. closes #5569 | 1 个月前 |