In function theme() core exit without any errors if theme hook wasn't registered:

  if (!isset($hooks[$hook])) {
    return;
  }

There should be some watchdog error for sure that this hook doesn't exist, so then user will know which module cause the problem instead of reinstalling Drupal or restoring Drupal.

This should inform user that this can't be rendered because of website error:

  if (!isset($hooks[$hook])) {
    watchdog('theme', 'Theme callback %callback is invalid', array('%callback' => $hook), WATCHDOG_ERROR); 
    return;
  }

Comments

Tresler’s picture

Category: bug » feature
Status: Needs review » Active

Well, a few things...

a) First, this isn't security related, so I'm bumping it to 7.x and changing it to geature request. A bug could be filed against the offending module, but not against core.

b) I'm not certain that a watchdog error is at all appropriate here. It would only be there to catch bugs in offending modules, and that, imo, is debugging code not needed in a live site. Ideally you are installing your modules on a test site, or at the very least one at a time so you know what the offending module is. Tracing it to the theme() function is /that/ modules job, not drupal core's

c) However, if you really think it deserves a place, roll a patch against 7.x and attach it before setting to 'needs review' please. Currently there is no patch here to review

Thanks

Tresler’s picture

Version: 6.9 » 7.x-dev
Anonymous’s picture

Status: Active » Closed (won't fix)

Agreed with Tresler, this would not have a place in core.