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.

CommentFileSizeAuthor
cacheget.patch721 bytesalpritt
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Quick fix

Looks reasonable.

Dries’s picture

Status: Reviewed & tested by the community » Needs work

Needs test?

catch’s picture

Status: Needs work » Needs review

Looks like an E_STRICT error to me? As far as I know we don't test these.

Dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

alpritt’s picture

Title: Taxonomy module causing WSOD » WSOD if theme() called before bootstrap completes
Status: Fixed » Active
Issue tags: -Quick fix

We 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).

catch’s picture

Title: WSOD if theme() called before bootstrap completes » WSOD if theme() called before bootstrap completes (E_STRICT)
Component: taxonomy.module » base system
alpritt’s picture

I want to be clear that this is not just an E_STRICT problem. For example, if you have...

function hook_init() {
  theme('whatever');
}

...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.

catch’s picture

Title: WSOD if theme() called before bootstrap completes (E_STRICT) » WSOD if theme() called before bootstrap completes

That'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.

alpritt’s picture

Status: Active » Fixed

No, that root issue is the same.

Damien Tournoud’s picture

Status: Fixed » Closed (won't fix)
Damien Tournoud’s picture

Status: Closed (won't fix) » Closed (duplicate)
SocialNicheGuru’s picture

How do you find the module that causes this or do I need to just step through each module one by one?