Right... after reviewing my options (and reporting this bug) I decided I wanted to disable this module for a bit to see if a couple of the outstanding issues would be resolved.

Unfortunately disabling the module broke the site (WSOD). I don't know what the score is with that.

FYI: To fix this, I had to manually re-enable the module in MySQL thusly:
update system set status='1' where filename='sites/default/modules/page_title/page_title.module';

Comments

niklp’s picture

No feedback on this? I'm still suffering this problem.

john morahan’s picture

Is your modified template.php still calling page_title_page_get_title()?

niklp’s picture

Ooooh I wish *I'd* thought of that...! :p

That's almost certainly the cause, isn't it? I'll have to check another time, as I can't replicate the error right now (site is in production).

The bug that was pointed to in my post above was (IIRC) fixed by updating the Views module (5.x-1.5?), which was incorrectly setting the page title via one of my blocks (an odd bug indeed).

I've not had any desire to disable this module again since, as the problem went away; however I think if I did, this would pretty much be the answer.

Thanks!

johnalbin’s picture

Title: Cannot uninstall module » Disabling module breaks site
Priority: Normal » Critical

Manually adding page_title’s required code to the template.php for each template used on a site is awkward. But I’m not sure how to fix that off the top of my head.

Besides adding something to the README.txt, I also can’t think of a way to warn users not to disable the module without first removing that code.

nicholasthompson’s picture

Title: Disabling module breaks site » Disabling module breaks site - if template.php calls page_title_page_get_title() with no module_exists check.
Priority: Critical » Minor
Status: Active » Closed (won't fix)

This is simply a coding error in the tempate.php.

If you're going to call a module specific function and then disable the module then inevitably the site will break. The latest template.php example should that you should wrap the $vars[] line with an if statement, turning it into something like this:

function _phptemplate_variables($hook, $vars) {
  $vars = array();
  if ($hook == 'page') {
    if (module_exists('page_title')) {
      $vars['head_title'] = page_title_page_get_title();
    }
  }
  return $vars;
}

Alternatively, instead of module_exists (or module_exist in 4.7) you could use PHP's function_exists() function.

niklp’s picture

I guess just finding out which of these calls is the "cheapest" is the best plan. Otherwise this just gets a(n untested) "bingo!" from me :)