No Code Attached Yet
avatar somecoder3
somecoder3
31 Jan 2023

Steps to reproduce the issue

You have to have a JSON error in the GSD data. In my case it was something with Unicode.

Expected result

Print the JSON error between the script tags like:
JSON error: Some JSON error message

Actual result

You get an PHP error: Array to string conversion

System information (as much as possible)

Joomla Version: 4.2.6
PHP Version: 7.4.8

Additional comments

The problem is in administrator/components/com_gsd/GSD/Json.php, in the method generate():

if (json_last_error() !== JSON_ERROR_NONE)
{
    $json_string = \JText::sprintf('JSON Error: %s.', json_last_error_msg()) . ' ' . $content;
}

The variable $content is the array, which couldn't be encoded to a JSON string. This can not be concated with the error message, and should be omitted.

avatar somecoder3 somecoder3 - open - 31 Jan 2023
avatar joomla-cms-bot joomla-cms-bot - change - 31 Jan 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 31 Jan 2023
avatar joomdonation joomdonation - change - 31 Jan 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-01-31 08:26:25
Closed_By joomdonation
avatar joomdonation joomdonation - close - 31 Jan 2023
avatar joomdonation
joomdonation - comment - 31 Jan 2023

This error comes from a third party extension, not from Joomla core. You need to contact the developer of that extension, report the issue to him and ask him to fix it.

Closing because this is not a Joomla core issue.

Add a Comment

Login with GitHub to post a comment