Bug Report: JSON.parse SyntaxError In Dynamic Collections List Due To Image Field (v6.3.0) - Question | JoomShaper

Bug Report: JSON.parse SyntaxError In Dynamic Collections List Due To Image Field (v6.3.0)

S-D CONSULTING

S-D CONSULTING

SP Page Builder 1 month ago

Hi, After updating SP Page Builder to version 6.3.0, accessing the list of items in a Dynamic Collection containing an "Image" field results in a broken page in the Joomla backend.

The browser console shows the following error during the XHR request to task=/collections.list: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

I want to point out that to be sure, I tried to download the full installer of the Agentik and Artolio versions, and I managed to reproduce the same problem also in your installation in Joomla 6, when you upgrade from Joomla 6.0.x to 6.0.3 and Page Builder 6.2.3 to 6.3.0.

To reproduce, just follow these steps:

  1. Create a Dynamic Collection.
  2. Add an "Image" field to the collection.
  3. Add a new item, upload/select an image, and save.
  4. Return to the Collection Items list. The page breaks.

In v6.3.0, the Image field now correctly saves data as a JSON string to include the Alt Text (e.g., {"src":"...","alt":""}).

You can understand this if you try a downgrade from 6.3.0 to 6.2.3, because in the image path field we find, between curly brackets, everything including the path and the alt text.

However, the backend service preparing the list wasn't updated to decode this new format.

In administrator/components/com_sppagebuilder/dynamic-content/Services/CollectionItemsService.php, inside the makeCollectionItem() method (around line 801), the code does this:

if ($value->field_type === FieldTypes::IMAGE) {
    $value->value = CollectionHelper::getImageUrl($value->value);
}

Since CollectionHelper::getImageUrl() expects a plain string path but receives a JSON string, it throws a PHP Warning. This PHP Warning gets printed before the actual JSON response, corrupting the payload and causing the React/JS frontend to crash during JSON.parse().

To fix the issue, I made a change to the above file and applied it locally, and it fixed the issue for me:

if ($value->field_type === FieldTypes::IMAGE) {
    $imageValue = $value->value;

    // Check if it's the new JSON format (v6.3.0+)
    if (is_string($imageValue) && strpos(trim($imageValue), '{') === 0) {
        $decodedData = json_decode($imageValue, true);
        if (is_array($decodedData) && isset($decodedData['src'])) {
            $imageValue = $decodedData['src'];
        }
    }

    // Pass the clean string to the helper
    $value->value = CollectionHelper::getImageUrl($imageValue);
}

Hope this helps the team release a quick fix in the next update!


I want to point out that in the tests performed on the Agentik and Artolio installations, to reproduce the error, all I had to do was enter an existing collection where an image was expected, access a record, save, and return to the list. This step, requiring the image URL field to be saved in the new json include format, immediately displayed the error.

0
11 Answers
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 1 month ago #219911

Hi

I have talked with our DEV team, and they said they fixed this issue in the latest version. Please keep a full site backup and try the latest version.

0
S-D CONSULTING
S-D CONSULTING
Accepted Answer
1 month ago #219914

Hi, I wanted to give you a quick response. I backed up the website where I encountered the problem (the first of the affected websites), updated Page Builder to version 6.3.1, ran some save tests, and opened and closed collections, and it no longer gives me errors.

Thank you, I think we can close this issue.

0
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 1 month ago #219916

Glad to know that. You are alsways welcome.

0
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 1 month ago #219203

Hi,

Thank you for contacting us, and we sincerely apologize for the inconvenience caused. We also appreciate your detailed explanation and for sharing the proposed solution with us.

I will forward this information to our team so they can review it carefully and evaluate the implementation.

Thank you again for your valuable feedback.

-Regards.

0
S-D CONSULTING
S-D CONSULTING
Accepted Answer
1 month ago #219212

Thank you. For now, I'm forced to apply this patch, which currently works on all websites where I'm using the same versions of Page Builder and Joomla.

I look forward to hearing from you in the release notes that you've fixed this bug.

0
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 1 month ago #219306

Ok I have talked with our DEV team and they said,it will be fixed by our next upcoming update. Maybe by next week, you can get the update release.

0
PhoenixGB
PhoenixGB
Accepted Answer
1 month ago #219284

Has an official fix been found for this yet? S_D, brilliant fix, thanks.

0
S-D CONSULTING
S-D CONSULTING
Accepted Answer
1 month ago #219785

Hi, I saw that version 6.3.1 of Page Builder was just released.

I read the release notes, but I didn't find any reference to this post. I'd like to know if the issue has been resolved, because if I apply the update and there's no fix, I'll have to redo all the post-update work that took me a long time to find a solution.

The release notes state:

Version 6.3.1 10 March 2026 New

Introduced Page Versioning to restore previously saved changes on pages

Updates

Added alt text support to the Dynamic Content Gallery field
Implemented Button option for Dynamic Content Link field
Added hover description support to the Gallery addon

Fixes

Resolved decimal formatting issues in the Dynamic Content number field
Fixed select field height inconsistency in the Form Builder addon
Addressed CSS rendering issues affecting sections in certain cases
Resolved a lazy loading conflict that affected background video playback
Improved nonEnglish language rendering in the Comment addon
Fixed text truncation in the frontend editor for the Dynamic Content Text addon
Restored Dynamic Content filter visibility when items are moved to trash
Improved SEF crawl behavior for Dynamic Content pages
0
Mehtaz Afsana Borsha
Mehtaz Afsana Borsha
Accepted Answer
Support Agent 1 month ago #219824

I need to check it. I will let you know.

0
PhoenixGB
PhoenixGB
Accepted Answer
1 month ago #219919

Can u let us know when the latest version has fixed this error, also for Joomla 5.43

Thanks

0
S-D CONSULTING
S-D CONSULTING
Accepted Answer
1 month ago #219920

It works for me now on both versions

0