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.
Hey hope someone can help me with this issue;
My page title module is not working correctly, that is, the additional words i add in the page title through the module are not shown. This problem appears every now and then. When i clear Drupal's cache the problem disappears! After some time (probably like half a day) the module just stops working correctly and i have to clear Drupal's cache. It's very annoying. Does anyone have any ideas?
Thanks!
Comments
Comment #1
WillGFP CreditAttribution: WillGFP commentedI set the page titles up a few days ago and it was working just fine then. Now I go onto the site today and suddenly they're missing. I cleared the cache, and just like he says above, they work again.
Comment #2
PixelPie CreditAttribution: PixelPie commentedSame problem here, with Drupal 7.12. Did anyone manage to find what's causing it?
Comment #3
dawansv CreditAttribution: dawansv commentedNoticed the same thing here; after a undetermined period of time tokens are no longer replaced until cache is cleared. Have not had time to investigate further yet...
Comment #4
nicholasThompsonThis is unusual - I've not experienced this on my own sites which uses this module.
What cache settings do you guys have (under the performance section)? You're not using Memcache or any other funky backend are you?
Is the problem that token value appear as raw (eg
[page:page-title]
)?If the problem was anywhere with Page Title, it would be around this function:
But if it cant find valid settings, it fails back to generating them from scratch and rebuilding the cache.
If this is an issue with PT, it certainly is something we need to look at.
Comment #5
nicholasThompsonIs this related to #1136512-1: Available Tokens List is empty? I have fixed that bug in dev and 2.6 shouldn't suffer that issue..
Comment #6
Rene Hostettler CreditAttribution: Rene Hostettler commentedI'm still having this issue in two sites trying to fix for a client using 2.7 version. Initially I thought it was related to an incompatibility with panels but only one of the sites is using panels pages.
Symptoms are the same as OP clearing cache shows the title but after approx half a day it's gone again. Also it seems to affect the [current-page:page-title] token only. Site name token is unaffected and displayed correctly.
Anyone have any ideas how to fix?
Comment #7
Rene Hostettler CreditAttribution: Rene Hostettler commentedCache settings were set to not cache for anonymous users. Have enabled minimum cache time settings for anonymous users and one site has been ok for 24 hours the other for three days now.
Has no one who experienced this issue have any pointers for solutions or workarounds?
Is it possible that it is a tokens issue rather then a Page Title issue?
Thanks
Comment #8
digickle CreditAttribution: digickle commentedExperiencing the same problem here. [current-page:page-title] randomly stops working. Disabling custom modules, clearing caches and using token_clear_cache(); seems to clear the problem, even after the modules are re-enabled.. But only for so long.
Comment #9
Rebekaloz CreditAttribution: Rebekaloz commentedSame problem with views datasource module stops working now and then, emptying cache fixs it.
Comment #10
shanly CreditAttribution: shanly commentedI've also been experiencing this issue. My colleague mparker17 and I have been discussing and we think the problem is in page_title_get_title() where it does an is_null() check. I think that check should be empty() instead because I don't think drupal_static() will ever return a null value (I may not understand drupal_static() well enough though.)
I've generated a patch based on that idea and we're testing it internally now.
Comment #11
Everett Zufelt CreditAttribution: Everett Zufelt commentedSame issue for us:
drupal_static() is meant to return NULL for unset variables.
Comment #12
Rebekaloz CreditAttribution: Rebekaloz commentedNice menus has the same behavior. I installed the same contributed modules, and selected same core modules in a fresh drupal installation, and this new site appears to behave ok, so maybe is got to do with configuration.
Comment #13
Rebekaloz CreditAttribution: Rebekaloz commentedDo you guys have google_analytics module installed I think that's it.
Comment #14
Undrium CreditAttribution: Undrium commentedThis problem occurs on numerous of my clients websites, anyone found a solution yet?
Comment #15
glycid CreditAttribution: glycid commentedUsing [current-page:title] Token instead of [current-page:page-title] solves the problem in my case and has the same effect.
Comment #16
leendertdb CreditAttribution: leendertdb as a volunteer commentedJust chipping in here for any future readers: we got the same behaviour after reducing the interval that the cron runs (from once per hour to 1x 12 hours) on one of our sites. #15 fixes the problem for us as well.
Comment #17
Dhruv Panchal CreditAttribution: Dhruv Panchal commentedHello,
Please use this drupal function to exclude cache : drupal_page_is_cacheable(FALSE);
Thanks,
Dhruv Panchal
Comment #18
cupcakemuncher CreditAttribution: cupcakemuncher commentedHi there!
Just in case someone is looking into this.
The problem can be reproduced by calling
drupal_not_found()
inhook_init()
.This reproduces the breaking of page-titles for all pages which are not configured with the default-setting.
When looking into model.inc we see that the
model_invoke
returns less hook-implementations.My working hypothesis is that Drupal is not detecting the other implementations. Maybe because the cache is build up/persisted differently when a page is not found.
The page_title-module does not include modules/node.page_title.inc anywhere and relies on Drupal including it.
Including
require_once join(DIRECTORY_SEPARATOR, [dirname(__FILE__), 'modules', 'node.page_title.inc']);
into page_title.module solves the problem.The hook-implementations in the other files might have the same problem(hasn't been tested though).