No Code Attached Yet Information Required PHP 8.x
avatar Stevec4
Stevec4
22 Mar 2023

Steps to reproduce the issue

Install J4.3 RC1.
In the backend I have 2 Deprecated messages when navigating around the backend of my site opening various Components.

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in C:\xampp\htdocs\sites\Joomla_4.3.x\libraries\src\HTML\Helpers\SearchTools.php on line 113

I fixed this first one by adding the null coalescing operator
$direction = strtolower($direction ?? ' ');

Deprecated: Automatic conversion of false to array is deprecated in C:\xampp\htdocs\sites\Joomla_4.3.x\libraries\src\HTML\HTMLHelper.php on line 790

System Info
Joomla 4.3 RC1
PHP 8.1.12
MariaDB

avatar Stevec4 Stevec4 - open - 22 Mar 2023
avatar joomla-cms-bot joomla-cms-bot - change - 22 Mar 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Mar 2023
avatar Quy
Quy - comment - 22 Mar 2023

Is this a clean installation with no 3rd party extensions? Please provide steps to reproduce as I am not getting these notices.

avatar Quy Quy - change - 22 Mar 2023
Labels Added: Information Required
avatar Quy Quy - labeled - 22 Mar 2023
avatar Stevec4
Stevec4 - comment - 22 Mar 2023

Hi Quy,
This is not a clean install of the RC but it was a clean install of Beta 4. While testing Beta 4 I did install a few 3rd party extensions.
Yootheme Template, Zoo, Widgetkit and DPCalendar the error messages only appear if I am navigating around the backend and not if I am using a joomla component.
As a test to see how J4 would be on php 8.1, I swictch from 8.0.28 to 8.1 and the deprecated notices appear.

Sorry with error reporting on max I don't see much else to point to.
Let me know if I can do something else to test where the error is coming from to help pin point it.

avatar Quy Quy - change - 23 Mar 2023
Labels Added: PHP 8.x
avatar Quy Quy - labeled - 23 Mar 2023
avatar joomdonation
joomdonation - comment - 25 Mar 2023

@Stevec4 It's very likely these deprecated messages come from third party extension. You can try to file modify the code in libraries\src\HTML\Helpers\SearchTools.php at line 113 to below code:

if ($direction === null) {
	debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
	die();
}

That should display the traces and you can see what extension causing this issue and report it to developer of that extension

For the Automatic conversion of false to array is deprecated, surely it causes by a third party extension calling HTMLHelper script method with wrong arguments passed (that was deprecated from Joomla 3.7.0 if I remember correctly), so not something from the core.

avatar Stevec4
Stevec4 - comment - 25 Mar 2023

Thank you Tuan, I will add that code snippet today and see what it points too.

Steve

avatar Stevec4
Stevec4 - comment - 25 Mar 2023

I was able to trace down a null being passed to the search tools fixed it and reported it.
Though I have not had much luck with the second one Automatic conversion of false to array is deprecated

When I look at my php logs is shows the following file as the referrer
PHP Deprecated: Automatic conversion of false to array is deprecated in ```
C:\xamp\htdocs\sites\Joomla_4.3.x\libraries\src\HTML\HTMLHelper.php on line 790, referer: http://localhost/sites/Joomla_4.3.x/administrator/index.php?option
=com_cpanel&view=cpanel&dashboard=system


avatar joomdonation
joomdonation - comment - 26 Mar 2023

@Stevec4 You can use the same approach to find the extension causing the Automatic conversion of false to array is deprecated warning. Just add the below line of code below to the line 790 of the file :

if (!is_array($options)) {
            debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
            die();
}
avatar Stevec4
Stevec4 - comment - 26 Mar 2023

@joomdonation
Perfect that did the trick, it was a 3rd party app trying to load a modal script.
So far no other deprecated msgs.
Thanks Tuan for the assistance tracking it down.

avatar joomdonation
joomdonation - comment - 26 Mar 2023

OK Steve. Happy it helped. I'm closing this issue because it is none core issue.

avatar joomdonation joomdonation - close - 26 Mar 2023
avatar joomdonation joomdonation - change - 26 Mar 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-03-26 11:04:56
Closed_By joomdonation

Add a Comment

Login with GitHub to post a comment