- Issue created by @pameeela
- πΊπΈUnited States phenaproxima Massachusetts
I think that, in Drupal CMS, we could add a
drush cr
as apost-update-cmd
Composer script. - πΊπΈUnited States phenaproxima Massachusetts
In addition to #3, we can also put the cache clear block (provided by core) into the dashboard, so users don't have to go digging around for it.
- πΊπΈUnited States phenaproxima Massachusetts
@catch directed me to π Use a better container cache key Active , which would also greatly mitigate this problem.
- πΊπΈUnited States mglaman WI, USA
chatted w/ phenaproxima and I understand the problem, now.
Sometimes after running an update, the cache becomes corrupted and has to be cleared.
This confused me. It's not _update_ as in Drupal database updates but dependency updates. A module is update which has modified it's service constructors. Drupal is still using a previous container cache for the previous version of the module. When the user goes to their Drupal site, the container constructs the services using previous arguments and we WSOD.
π Use a better container cache key Active solves this by using dependency version information to vary the container cache. So I think Drupal CMS can provide a Composer script which _kind of_ does the same thing. Without calling `drupal_rebuild`. When calling `drupal_rebuild` all caches get destroyed, which can be bad ahead of actually running updates.
Instead it should have a script which does clears the container cache only. This can be done via
drush cc container
or a PHP script like:$autoloader = require_once __DIR__ . '/autoload.php'; $request = Request::createFromGlobals(); $kernel = new DrupalKernel('prod', $class_loader); $kernel->setSitePath(DrupalKernel::findSitePath($request)); $kernel->invalidateContainer();
- π¦πΊAustralia pameeela
@mglaman updated the IS to clarify that yes it's composer updates rather than db updates!