RTC PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar HLeithner
HLeithner
18 Apr 2024

Summary of Changes

Deprecate the legacy parameter $JComponentTitle from WebApplication. This should have been done when the variable has been created. Sadly it has been missed.

Testing Instructions

No test needed

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar HLeithner HLeithner - open - 18 Apr 2024
avatar HLeithner HLeithner - change - 18 Apr 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2024
Category Modules Administration Libraries
avatar HLeithner HLeithner - change - 18 Apr 2024
The description was changed
avatar HLeithner HLeithner - edited - 18 Apr 2024
avatar brianteeman brianteeman - test_item - 18 Apr 2024 - Tested successfully
avatar brianteeman
brianteeman - comment - 18 Apr 2024

I have tested this item ✅ successfully on 247c409


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43304.

avatar ChristineWk
ChristineWk - comment - 18 Apr 2024

J 5.2.0-alpha1-dev
Code Review


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43304.

avatar ChristineWk ChristineWk - test_item - 18 Apr 2024 - Tested successfully
avatar ChristineWk
ChristineWk - comment - 18 Apr 2024

I have tested this item ✅ successfully on 247c409


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43304.

avatar Quy Quy - change - 18 Apr 2024
Status Pending Ready to Commit
Labels Added: PR-5.2-dev
avatar Quy
Quy - comment - 18 Apr 2024

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43304.

avatar wilsonge
wilsonge - comment - 18 Apr 2024

The usage in mod_title goes back to at least joomla 1.6 and I suspect earlier (

$title = &JFactory::getApplication()->get('JComponentTitle');
). Whilst it definitely belonged in AdministratorApplication and not WebApplication, I think this needs better docs than just deprecated because core isn’t using it, we don’t know what plugins or admin modules might be using this from days gone old. Such as what is the correct method for plugins etc to set a page title. I believe when production made the rule of 2 major versions deprecation the deprecation also had to include a replacement method

avatar HLeithner
HLeithner - comment - 18 Apr 2024

Replacement is set or get title Form the document AS documented in the deprecation.

avatar laoneo
laoneo - comment - 19 Apr 2024

Should you then not fallback to the document title here https://github.com/joomla/joomla-cms/pull/43304/files#diff-a35dff7f70b05500db42e3f582368ededb2d2477bbc955142c16a0038e184a6cR40, when this should be the replacement?

avatar HLeithner
HLeithner - comment - 19 Apr 2024

Should you then not fallback to the document title here https://github.com/joomla/joomla-cms/pull/43304/files#diff-a35dff7f70b05500db42e3f582368ededb2d2477bbc955142c16a0038e184a6cR40, when this should be the replacement?

We do this when the variable gets removed in 7.0

$app->getDocument()->setTitle($title);

Until then we have to use the variable because we can't (or don't do) intercept when someone sets the JComponentTitle by hand in the application.

So yes in 7.0 we have to use document->getTitle() in the module.

avatar laoneo
laoneo - comment - 19 Apr 2024

I think this should be done now as fallback, something like:

$data['title'] = isset($this->getApplication()->JComponentTitle) ? $this->getApplication()->JComponentTitle : $this->getApplication()->getDocument()->getTitle();
avatar HLeithner
HLeithner - comment - 19 Apr 2024

since this is only used for mod_title and only in combination with the toolbar::title function it's something which would be a behavior change which could be unexpected. ex. if your want to remove the title for you extension $app->JComponentTitle = ''; or null worked the last 15 years. If you change this now you can remove the variable and functionality directly and would have the same effect.

Extension developer have to set it in $doc->setTitle();.

only a thought I have I didn't proofed if this is a usecase

avatar laoneo
laoneo - comment - 19 Apr 2024

As it is an isset() check, '' or null would still work, as long as the variable exists.

avatar HLeithner
HLeithner - comment - 19 Apr 2024

As it is an isset() check, '' or null would still work, as long as the variable exists.

I'm sorry but that's wrong

avatar laoneo
laoneo - comment - 19 Apr 2024

True, null is not covered

avatar pe7er pe7er - change - 23 Apr 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-04-23 07:37:29
Closed_By pe7er
Labels Added: RTC
avatar pe7er pe7er - close - 23 Apr 2024
avatar pe7er pe7er - merge - 23 Apr 2024
avatar pe7er
pe7er - comment - 23 Apr 2024

Thanks @HLeithner !

Add a Comment

Login with GitHub to post a comment