User tests: Successful: Unsuccessful:
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.
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.
It is only done for Articles and Contacts!
Custom fields have always the last saved value
Custom fields have the value from the saved version
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
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_contact com_content com_contenthistory Libraries Front End Plugins |
Labels |
Added:
PR-6.0-dev
|
Labels |
Added:
b/c break
|
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
Title |
|
Labels |
Added:
Feature
|
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.