Project

General

Profile

Actions

Bug #54467

closed

$GLOBALS['TSFE']->altPageTitle doesn't work any more in extensions

Added by Bill Dagou almost 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-12-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

typo3.updated.zip (27.4 KB) typo3.updated.zip Bill Dagou, 2014-01-13 08:17
PageRenderer.html (1.04 MB) PageRenderer.html Bill Dagou, 2014-01-13 09:36
PageGenerator.html (481 KB) PageGenerator.html Bill Dagou, 2014-01-13 09:36
title.diff (1.98 KB) title.diff Make title changable for USER_INT ext Markus Klein, 2014-01-13 11:02
0001-BUGFIX-title.patch (5.59 KB) 0001-BUGFIX-title.patch Patch should make changes to TSFE->altPageTitle working again in *_INT Markus Klein, 2014-01-13 14:54

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #62080: $GLOBALS['TSFE']->page['title'] in USER doesn't work anymore for cached pagesClosedMarkus Klein2014-10-07

Actions
Actions #1

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.

Actions #2

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.

Actions #3

Updated by Bill Dagou almost 11 years ago

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

Actions #4

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

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

Actions #6

Updated by Markus Klein almost 11 years ago

Thx much better. ;-)

Don't you have a diff command on your machine?

Actions #7

Updated by Bill Dagou almost 11 years ago

No, I'm using Beyond Compare. :D

Bill

Actions #8

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.
Actions #9

Updated by Bill Dagou almost 11 years ago

1. USER_INT
2. Seems not working.

Actions #10

Updated by Markus Klein almost 11 years ago

Can you please try if my patch works when setting the title in your ext using
$GLOBALS['TSFE']->getPageRenderer()->setTitle()

Actions #11

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

Actions #12

Updated by Markus Klein almost 11 years ago

I see.

Can you please test, if this patch works now if you're using altPageTitle = 'asdf' again in your extension?

Actions #13

Updated by Bill Dagou almost 11 years ago

Yes, it works perfect.

Bill

Actions #14

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

Actions #15

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

Actions #16

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

Actions #17

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

Actions #18

Updated by Markus Klein almost 11 years ago

Bill, would you mind voting on the patch as well?

Actions #19

Updated by Bill Dagou almost 11 years ago

Sure, I'd like to. How can I vote for a patch?

Bill

Actions #20

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.

Details: http://wiki.typo3.org/Gerrit_Review_Workflow

Actions #21

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

Actions #22

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

Actions #23

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

Actions #24

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

Actions #25

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

Actions #26

Updated by Markus Klein almost 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #27

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF