Feature b/c break PR-6.0-dev Pending

User tests: Successful: Unsuccessful:

avatar rdeutz
rdeutz
22 May 2025

Our versioning works on databse table level, this leads to situations that we save an article with custom fields but the CF are not included in the history. This is unexpected from a user perspective. This PR starts to change this behaviour so that releated information are also saved.

Summary of Changes

I have added an interface VersionableModelInterface, if a model implements this interface then in AdminModel the save of the histroy data is done in the save method (calls saveHistory) of the Model. This is the first step and we have now the data with releated information in the history table.

If you want to restore a version then in loadHistory (VersionableModelTrait) set the data from the history table as session data and loadForm use this data when you edit an item.

It works for CF so far. At the moment not for Tags (tags is a pain, we might change more on tags for 6 so I haven't looked into the details why not).

This is a b/c break and I don't know how many are affected but I think that it can't be too much hassle and what we get when we finish this is worth the work for extensions developers.

  • Look into tags
  • Extend to other core items where we are using versions (Banner, Banner Client, newfeeds, Categories Tags).
  • Remove behaviour plugin
  • Fix tests

Testing Instructions

It is only done for Articles and Contacts!

  • Create some custom fields
  • Create an article and save some versions of it
  • Restore versions back and force

Actual result BEFORE applying this Pull Request

Custom fields have always the last saved value

Expected result AFTER applying this Pull Request

Custom fields have the value from the saved version

Link to documentations

Documentation will be provided at a later stage.

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 rdeutz rdeutz - open - 22 May 2025
avatar rdeutz rdeutz - change - 22 May 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 May 2025
Category Administration com_contact com_content com_contenthistory Libraries Front End Plugins
avatar rdeutz rdeutz - change - 22 May 2025
Labels Added: PR-6.0-dev
avatar rdeutz rdeutz - change - 22 May 2025
Labels Added: b/c break
avatar rdeutz rdeutz - change - 22 May 2025
The description was changed
avatar rdeutz rdeutz - edited - 22 May 2025
avatar rdeutz rdeutz - change - 22 May 2025
The description was changed
avatar rdeutz rdeutz - edited - 22 May 2025
avatar peterpeter peterpeter - test_item - 31 May 2025 - Tested successfully
avatar peterpeter
peterpeter - comment - 31 May 2025

I have tested this item ✅ successfully on eb8533b

Successful tested with a text-, integer-, list- and checkboxfield(s).

B.t.w.
Comparing versions is throwing an error:
https://prnt.sc/bvWwN0TaKwSq
with or without this patch


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

avatar peterpeter peterpeter - test_item - 31 May 2025 - Tested successfully
avatar peterpeter
peterpeter - comment - 31 May 2025

I have tested this item ✅ successfully on eb8533b

Successful tested with a text-, integer-, list- and checkboxfield(s).

B.t.w.
Comparing versions is throwing an error:
https://prnt.sc/bvWwN0TaKwSq
with or without this patch


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

avatar richard67 richard67 - change - 3 Jun 2025
Title
[6.0] RFC extend versioning, save releated information in history table and restore historcal data
[6.0] RFC extend versioning, save releated information in history table and restore historical data
avatar richard67 richard67 - edited - 3 Jun 2025
avatar rdeutz rdeutz - change - 12 Jun 2025
Labels Added: Feature

Add a Comment

Login with GitHub to post a comment