Bug #54467
closed$GLOBALS['TSFE']->altPageTitle doesn't work any more in extensions
100%
Description
Dear TYPO3 Team,
I just found $GLOBALS['TSFE']->altPageTitle doesn't work any more in extensions. I tried print out $pageContent and $GLOBALS['TSFE']->altPageTitle in \TYPO3\CMS\Frontend\Page\renderContent(), the real contents are marked as something like , and $GLOBALS['TSFE']->altPageTitle is empty. So I guess $GLOBALS['TSFE']->altPageTitle is filled with extensions after renderContent() (real function would be renderContentWithHeader()).
I used to set $GLOBALS['TSFE']->altPageTitle = 'bla bla bla' in other extension in v4.5, and it worked well. Seem the problem also happens in v6.0, but I'm using v6.1 right now.
Cheers,
Bill
Files
Updated by Bill Dagou almost 11 years ago
And seems the <title> are also cached when using config.titleTagFunction, can not customize the <title> tag based on different records easily.
Updated by Markus Klein almost 11 years ago
This seems to be an issue in the PageRenderer.php.
I guess in getPreparedMarkerArrayForPageWithUncachedObjects() the TITLE marker needs to be constructed like HEADERDATA is.
In renderJavaScriptAndCssForProcessingOfUncachedContentObjects() the title needs to be filled then.
Please also check the methods executePreRenderHook() and executeRenderPostTransformHook(), which might need the title added as well.
Updated by Bill Dagou almost 11 years ago
- File typo3.updated.zip typo3.updated.zip added
Hi Markus,
Please see the attached files. I moved the Title code from PageGenerator.php to PageRenderer.php, and updated the functions you mentioned in PageRenderer.php.
Feel free to let me know your thoughts.
Cheers,
Bill
Updated by Markus Klein almost 11 years ago
Hi Bill,
please upload a patch file and not a zip. It is very hard to find the exact differences within a complete source file, especially on mobile devices.
If possible for you, please provide the changes from current master, as this could then be easily pushed to the review system.
(Potential backports will be done after the master patch has been merged.)
Updated by Bill Dagou almost 11 years ago
- File PageRenderer.html PageRenderer.html added
- File PageGenerator.html PageGenerator.html added
Hi Markus,
Sorry, I'm afraid I don't have the account & permission to upload my files, or even GIT setup in my computer.
How about the 2 .html files? Easy for you to see the differences.
Cheers,
Bill
Updated by Markus Klein almost 11 years ago
Thx much better. ;-)
Don't you have a diff command on your machine?
Updated by Markus Klein almost 11 years ago
Some questions/comments:
- Is your extension of type USER or USER_INT?
- Why do you need to modify altPageTitle directly? Does $GLOBALS['TSFE']->getPageRenderer()->setTitle() work for your?
- I'd would not remove code from the PageGenerator.
Updated by Markus Klein almost 11 years ago
- File title.diff title.diff added
Can you please try if my patch works when setting the title in your ext using$GLOBALS['TSFE']->getPageRenderer()->setTitle()
Updated by Bill Dagou almost 11 years ago
Hi Markus,
Yes, it works. However, when I use $GLOBALS['TSFE']->getPageRenderer()->setTitle() in the ext, the TS like config.noPageTitle, config.pageTitleFirst, and config.titleTagFunction would not work.
Thanks,
Bill
Updated by Markus Klein almost 11 years ago
- File 0001-BUGFIX-title.patch 0001-BUGFIX-title.patch added
I see.
Can you please test, if this patch works now if you're using altPageTitle = 'asdf' again in your extension?
Updated by Gerrit Code Review almost 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26785
Updated by Gerrit Code Review almost 11 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26785
Updated by Gerrit Code Review almost 11 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26785
Updated by Gerrit Code Review almost 11 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26785
Updated by Markus Klein almost 11 years ago
Bill, would you mind voting on the patch as well?
Updated by Bill Dagou almost 11 years ago
Sure, I'd like to. How can I vote for a patch?
Bill
Updated by Markus Klein almost 11 years ago
Cool. Simply click on one of the link above. They will bring you to Gerrit, our review system.
There you can sign in (top right corner) with your typo3.org account.
After that a 'review' button shows up and you can vote.
Updated by Gerrit Code Review almost 11 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26785
Updated by Gerrit Code Review almost 11 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26785
Updated by Gerrit Code Review almost 11 years ago
Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27135
Updated by Gerrit Code Review almost 11 years ago
Patch set 2 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27135
Updated by Gerrit Code Review almost 11 years ago
Patch set 3 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27135
Updated by Markus Klein almost 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 9d4cacedf313200492a7ae0103b39a42d5cb92fa.