Bootstrap Drupal correctly from inside SimpleSAMLphp #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was previously reported in #75 but closed as outdated, however it is still an issue.
When certain caches are cold or stale, it is possible for them to be rebuilt during a request that is wrapped by SimpleSAMLphp instead of Drupal's own index.php. However when this happens, the cache is not rebuilt correctly and are missing critical data. This then results in various errors related to missing fields on the Drupal site such as:
or errors with missing plugins:
This is because
DrupalHelper::bootDrupal()
does not fully bootstrap Drupal correctly before calling core services which may go on to initialise caches. In particular theDrupalKernel::preHandle()
method is not called which is responsible for loading all modules, which causes the rebuilt caches to skip items from those modules and cause the errors later down the line.As per the comment if you look at
FunctionalTestSetupTrait::initKernel()
or even/authorize.php
you will see the correct way of partially bootstrapping Drupal without callingDrupalKernel::handle()
is to callpreHandle()
(which callsloadLegacyIncludes()
but also does a bit more).