This isn't good. I have a custom home page which uses views and panels. Unfortunately, panels doesn't allow me to override the page title.
Now, what's happening is, I have a front page; it has left, centre and right columns. I also have left and right blocks on this page. One of the blocks contains a view. The view contains nodes which make use of page_title.module. The view is also randomised. This is not important, but it helped me notice the bug. The front page's title changes sporadically.
Basically, the title of the front page of my website is changing randomly to match that of the title of the node which is last in the list of the random nodes in my block's view.
My home page's panel does not override the default title of the page, whereas the page_title does. This is clearly a bug.
Comments
Comment #1
niklp commentedFurther to this, I think this problem is caused by the page_title_page_get_title() being called several times by each node that is being rendered on the page. I'm partially guessing here, but I suspect the first call is being made by the page_title module itself (because it knows it's the front page that's being rendered). The other nodes on the page then get rendered, including my x nodes in my right col block, which have page_titles set on them. These each make a call to page_title_page_get_title(), and so the resulting page title is that which was set by the last call to the function, ie that of the last node in the right col block.
I have an inkling that maybe there is a simple check that could be performed to see if the node that is calling page_title_page_get_title() is the "main focus" of the page that is being rendered? It would then obviously be a simple task to program "if not main node don't set page title".
If this is correct, then this fix would the problem, I think.
Comment #2
niklp commentedI'm wondering if anyone actually understood the first post I wrote on this! I think I must have been pretty tired...
Just to add further bonkers-ness to this issue, the issue goes away if you empty the title of the panel in admin...
Comment #3
niklp commentedI'll take critical off this cos it isn't, and it seems pretty sporadic.
Comment #4
niklp commentedI'm pretty sure that this was fixed by updating the Views module (to 5.x-1.5, IIRC - when it came out). It's not actually anything to do with page_title. Which is probably why no-one was talking to me... :p
Thought I'd better note this here though.
Comment #5
johnalbinIf you experience it again, you can re-open this issue.
Comment #6
nicholasthompsonThanks John
Comment #7
dries commented