User tests: Successful: Unsuccessful:
Deprecate the legacy parameter $JComponentTitle from WebApplication. This should have been done when the variable has been created. Sadly it has been missed.
No test needed
Please select:
Status | New | ⇒ | Pending |
Category | ⇒ | Modules Administration Libraries |
J 5.2.0-alpha1-dev
Code Review
I have tested this item ✅ successfully on 247c409
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
PR-5.2-dev
|
RTC
The usage in mod_title goes back to at least joomla 1.6 and I suspect earlier (
). 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 methodReplacement is set or get title Form the document AS documented in the deprecation.
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?
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
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.
I think this should be done now as fallback, something like:
$data['title'] = isset($this->getApplication()->JComponentTitle) ? $this->getApplication()->JComponentTitle : $this->getApplication()->getDocument()->getTitle();
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
As it is an isset() check, '' or null would still work, as long as the variable exists.
As it is an isset() check, '' or null would still work, as long as the variable exists.
I'm sorry but that's wrong
True, null is not covered
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
|
Thanks @HLeithner !
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.