• Fabrik4.5.3 for J!5.3.0 and J!4.2+is out

    You must update from Fabrik4.5.1 if you are running Joomla!5.3.0

    See Announcements

Solved Preventing deprecated notices within eval()....

p38

Well-Known Member
Hi All, I found that even though I set Joomla error to NONE, the eval() code available in advanced options of checkbox element still displays the deprecated notice....

JHTML::_('select.option', $row->id, $row->title);} return $options; : Support for a three segment service key is deprecated and will be removed in Joomla 5.0, use the service registry instead

Does anyone know what the JHTML equivalent is to prevent this notice?

Either that, or the checkbox element would have to be modified to ignore deprecated notices.

It may be noted that the eval() code in dropdowns do not show the same deprecated notices, which is why I am assuming an issue with checkbox specifically
 
Does it additionally say something like E_USER_DEPRECATED... and you are logged in as admin and have J! SystemDebug enabled?
It should not show up to normal users.
But anyway

The tooltip says
$options[] = HTMLHelper::_('select.option', $row->id, $row->text);
I think you additionally have to add
use Joomla\CMS\HTML\HTMLHelper;
(I didn't test).
 
Thanks troester, I tried your suggestion but no difference.

E_USER_DEPRECATED --- An error has occurred with a eval'd field - please inform the web-site owner.

This is the message. I can confirm switching off Jdebug hides the error.

However, considering I am making changes to all my sites I would like to make sure all changes support Joomla5

So if anyone is interested, with some more digging, I found this which suggests what to use instead for J5, as this will be needed.
https://github.com/joomla/joomla-cms/issues/39556

so.......
JHTML::_('select.option', $row->id, $row->title);

becomes

\Joomla\CMS\HTML\Helpers\Select:: option($row->id, $row->title);

Thanks
Paul
 

Members online

No members online now.
Back
Top