RTC bug PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar travisrisner
travisrisner
25 Jul 2025

Pull Request for Issue #45782

Summary of Changes

When restoring an article from version history, the ordering field may be null if the version was saved during the initial creation of the item. This caused issues restoring that first version since the ordering column in the database is non-nullable and required.

This PR adds a safeguard in the restore process to explicitly set ordering = 0 if it is null in the versioned data. This prevents database errors or broken record state during restore. It also goes ahead and patches version saves to ensure a null ordering value cannot be saved.

Testing Instructions

  1. Create a new article and save it for the first time.
  2. Open the article again and save it a second time (creates a version).
  3. Restore the first version via the Versions interface.
  4. Ensure the article is restored correctly without errors and appears in the list with ordering value 0.
  5. Optionally, verify that manually reordered articles are unaffected.

Actual result BEFORE applying this Pull Request

  • Restoring the very first version of an article (before it had a valid ordering value) fails or causes an invalid NULL ordering to be saved.
  • Article may not appear in the frontend or backend list correctly, depending on DB settings.

Expected result AFTER applying this Pull Request

  • Restoring any version of an article works without error.
  • If ordering was null, it is now safely set to 0.
  • Article is visible and ordered safely in lists.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar travisrisner travisrisner - open - 25 Jul 2025
avatar travisrisner travisrisner - change - 25 Jul 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jul 2025
Category Libraries
avatar travisrisner travisrisner - change - 25 Jul 2025
Labels Added: PR-5.3-dev
avatar muhme muhme - test_item - 26 Jul 2025 - Tested successfully
avatar muhme
muhme - comment - 26 Jul 2025

I have tested this item ✅ successfully on d8a14bd


Tested before applying this PR, with JBT graft Joomla_5.3.3-dev-Development-Full_Package.zip:

  • Created an article with two versions, first version is not restorable in backend view, error Column 'ordering' cannot be null

Tested with this PR, by graft Joomla_5.3.3-dev+pr.45783-Development-Full_Package.zip:

avatar ceford ceford - test_item - 28 Jul 2025 - Tested successfully
avatar ceford
ceford - comment - 28 Jul 2025

I have tested this item ✅ successfully on d8a14bd

Tested with Workflow enabled.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45783.

avatar richard67 richard67 - change - 29 Jul 2025
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 29 Jul 2025

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45783.

avatar muhme muhme - change - 30 Jul 2025
Labels Added: RTC bug
avatar rdeutz rdeutz - change - 1 Aug 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-08-01 14:32:41
Closed_By rdeutz
avatar rdeutz rdeutz - close - 1 Aug 2025
avatar rdeutz rdeutz - merge - 1 Aug 2025
avatar rdeutz
rdeutz - comment - 1 Aug 2025

Thanks!

Add a Comment

Login with GitHub to post a comment