Use a statement such as:
JHTML::_('select.option', 8800, 'Bulletin Board')
The option is created without error or warning
The option is created by I am getting the following warning:
Support for a three segment service key is deprecated and will be removed in Joomla 5.0, use the service registry instead
What exactly does this mean and what do I do to get rid of this warning?
Latest J4.2.6
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
That means thing like JHTML::_('segment1.segment2.segment3')
is deprecated.
I think you got warning from somewhere else, not from JHTML::_('select.option', 8800, 'Bulletin Board')
, it have 2 segments.
it have 2 segments.
No.
JHTML::_('select.option', 8800, 'Bulletin Board')
or
HTMLHelper::_('select.option', 8800, 'Bulletin Board')
have 3 segments/parts at the end where the deprecated message is thrown:
jhtml
select
option
https://github.com/joomla/joomla-cms/blob/4.2-dev/libraries/src/HTML/HTMLHelper.php#L89-L94
Several HTMLHelper calls will appear with 3 segments.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-01-05 10:06:12 |
Closed_By | ⇒ | Fedik |
Ah okay, I see, it called second tyme by HTMLHelper::register()
with modified key.
@skurvish you should not worry about this message, it not a bug, just a notification about future changes.
Just set error reporting to exclude Deprecation messages.
Thanks.
Use of Joomla\CMS\HTML\HTMLHelper::_('select.option', 8800, 'Bulletin Board')
is safe.
I don't know. That's hidden in the darkness of undocumented improvements that aren't used yet in Joomla 4 ;-)
All I know is that you can use
Joomla\CMS\HTML\Helpers\Select::option(8800, 'Bulletin Board');
but is that what we shall use after readinguse the service registry instead
?