No Code Attached Yet
avatar deepalimad
deepalimad
1 Sep 2025

Description

When using Joomla’s versioning system to compare two versions of an item that includes subform fields, the following error is thrown:

htmlspecialchars(): Argument #1 ($string) must be of type string, stdClass given

This occurs when subform field values are stored as an object (stdClass) and Joomla attempts to render them as if they were simple strings.

Steps to Reproduce

  1. Enable Content Versioning in Joomla.
  2. Create an article (or any item in a component) that has a Subform field.
  3. Save the item → Version 1 created.
  4. Edit the item, change subform values, and save again → Version 2 created.
  5. Open Versions and try to Compare Version 1 and Version 2.
    Here is the video link to reproduce the issue
    https://sc.com.ly/show/eeda3d41-9dd1-4bb9-9f27-758072633787

Expected Result

Joomla should highlight the specific changes in subform values without throwing an error.

Actual Result

The system throws the following error:

htmlspecialchars(): Argument #1 ($string) must be of type string, stdClass given

Additional Notes

  • This affects both Joomla core (com_content with subform fields) and custom components generated by Component Creator.
  • Joomla version: [insert version tested, e.g., 5.1.x or 4.x].
  • PHP version: [insert version].
Image
avatar deepalimad deepalimad - open - 1 Sep 2025
avatar joomla-cms-bot joomla-cms-bot - change - 1 Sep 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Sep 2025
avatar richard67
richard67 - comment - 1 Sep 2025

Joomla version: [insert version tested, e.g., 5.1.x or 4.x].

@deepalimad Which Joomla version?

avatar deepalimad
deepalimad - comment - 1 Sep 2025

@richard67 Joomla 5.3

avatar brianteeman
brianteeman - comment - 4 Sep 2025

I am unable to replucate this with core com_content and subforms. Are you sure? This does not surprise me as versioning of custom fields is not currently supported and is why we have a pr in progress to add that

Add a Comment

Login with GitHub to post a comment