No Code Attached Yet
avatar skurvish
skurvish
4 Jan 2023

Steps to reproduce the issue

Use a statement such as:

JHTML::_('select.option', 8800, 'Bulletin Board')

Expected result

The option is created without error or warning

Actual result

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?

System information (as much as possible)

Latest J4.2.6

Additional comments

avatar skurvish skurvish - open - 4 Jan 2023
avatar skurvish skurvish - change - 4 Jan 2023
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 4 Jan 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Jan 2023
avatar ReLater
ReLater - comment - 4 Jan 2023

What exactly does this mean

I don't know. That's hidden in the darkness of undocumented improvements that aren't used yet in Joomla 4 ;-)

what do I do to get rid of this warning?

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 reading use the service registry instead?

avatar Fedik
Fedik - comment - 5 Jan 2023

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.

avatar ReLater
ReLater - comment - 5 Jan 2023

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

avatar ReLater
ReLater - comment - 5 Jan 2023

https://github.com/joomla/joomla-cms/blob/4.2-dev/libraries/src/HTML/HTMLHelper.php#L89-L94

  • Add line HTMLHelper::_('select.option', '0', 'JDISABLED'); in Cassiopeia index.php.
  • Debug code place above with a print_r or whatever.

Several HTMLHelper calls will appear with 3 segments.

avatar Fedik Fedik - change - 5 Jan 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-01-05 10:06:12
Closed_By Fedik
avatar Fedik Fedik - close - 5 Jan 2023
avatar Fedik
Fedik - comment - 5 Jan 2023

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.

Add a Comment

Login with GitHub to post a comment