Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Strict warning: Declaration of TaxonomyTermController::cacheGet() should be compatible with that of DrupalDefaultEntityController::cacheGet() in drupal_load() (line 823 of /Users/alanpritt/Sites/htdocs/drupal/includes/bootstrap.inc).
This caused a WSOD on my machine when enabling taxonomy module.
Comment | File | Size | Author |
---|---|---|---|
cacheget.patch | 721 bytes | alpritt | |
Comments
Comment #1
catchLooks reasonable.
Comment #2
Dries CreditAttribution: Dries commentedNeeds test?
Comment #3
catchLooks like an E_STRICT error to me? As far as I know we don't test these.
Comment #4
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #5
alpritt CreditAttribution: alpritt commentedWe can test E_STRICT simply by having E_STRICT enabled when tests are run. The only reason this isn't on as default yet is because there are E_STRICT errors that still need fixing. On my machine where I do have it switched on the taxonomy tests already fail spectacularly. see #348448: Always report E_STRICT errors.
However, ideally they shouldn't actually fail; but instead show failures. The failures occur because of the WSOD.
As I currently understand it, the WSOD is occurring because in _theme_load_registry() we do a check to make sure we have reached the DRUPAL_BOOTSTRAP_FULL phase before saving the registry. When the strict warning is thrown this fails because when this function runs we've not yet reached that phase and so the registry never gets set.
This happens because the strict warning leads to theme('placeholder') being called too early by our custom error handler.
In _drupal_bootstrap_full() we begin by setting the custom error handler. Then we call module_load_all() where the strict parse error occurs. This is now trapped by our custom error handler which calls theme('placeholder'). That sets up the registry which at this stage is not cached because we have just enabled a new module. The registry does not get set because the full_bootstrap is not quite complete. And finally bootstrap completes and the phase gets updated.
This could be a problem if theme() is called by hook_init() or just by loading the file (as is the case with this strict error).
Comment #6
catchComment #7
alpritt CreditAttribution: alpritt commentedI want to be clear that this is not just an E_STRICT problem. For example, if you have...
...then clear the cache you will get a WSOD.
The problem is that if theme() gets called prior to final bootstrap completing, the theme registry doesn't get set because
if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL)
in _theme_load_registry() is FALSE.But when theme() is called subsequent times (after bootstrap is complete) it doesn't even attempt to set the registry (_theme_load_registry() doesn't get called again) because it assumes it was successful on the first call.
I'm not sure if there is a use case for using a theme function so early, so in reality warning messages that use theme('placeholder') may actually be the only practical problem.
Comment #8
catchThat's a good point. Is there anything different here from #592008: Don't save theme registry before modules are included now? It seems not to me, but I'll let you close it if that's the case.
Comment #9
alpritt CreditAttribution: alpritt commentedNo, that root issue is the same.
Comment #10
Damien Tournoud CreditAttribution: Damien Tournoud commentedComment #11
Damien Tournoud CreditAttribution: Damien Tournoud commentedComment #12
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedHow do you find the module that causes this or do I need to just step through each module one by one?