? ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
30 Mar 2021

Pull Request for Issue #32890.

Summary of Changes

Load data from current version before replacing it with data from history to avoid error if there are some required keys are missing in the history data. See #32890 to understand more about the issue.

Testing Instructions

  1. See #32890 , confirm the issue
  2. Apply patch, confirm that the issue is sorted . Please test by both restore category and article from it's first version.
avatar joomdonation joomdonation - open - 30 Mar 2021
avatar joomdonation joomdonation - change - 30 Mar 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Mar 2021
Category Libraries
0f660f7 30 Mar 2021 avatar joomdonation CS
avatar joomdonation joomdonation - change - 30 Mar 2021
Labels Added: ?
3f528c6 30 Mar 2021 avatar joomdonation CS
avatar joomdonation joomdonation - change - 30 Mar 2021
The description was changed
avatar joomdonation joomdonation - edited - 30 Mar 2021
avatar ceford
ceford - comment - 30 Mar 2021

For me this works fine for Articles but for Categories I do not get a list of Versions to choose from. Is there some setting I have missed?


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

avatar joomdonation
joomdonation - comment - 30 Mar 2021

@ceford I think you will have to edit the category, then change something (so the data changed) to have system save it as new version. Could you please try that?

avatar PhilETaylor
PhilETaylor - comment - 30 Mar 2021

Im not sure this is the correct fix, as these values do exist at some point, but if it works it works :) ?

avatar ceford
ceford - comment - 30 Mar 2021

I tried changing a Category option as well as adding lines of text to the description. And I tried on a separate installation I use for other testing. In neither case do I get a list of Versions. I looked in the #__history table - there are entries for the article content but no entries for the category. So there must be some way to enable history versions in categories that I have missed,


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

avatar joomdonation
joomdonation - comment - 30 Mar 2021

I'm not sure this is the correct fix, as these values do exist at some point, but if it works it works :) ?

From what I see, at least for article, when you save a new article, data for ordering is not available and it is set to 0 (0 is default value for ordering field)

I believe the same thing happens for category on first save (first version). Some data is not available on saving process (at least when the system tries to save version history), so it makes sense to set default value like in the propose code.

avatar joomdonation
joomdonation - comment - 30 Mar 2021

@ceford Are you creating category for article? If not, please do so. Also, do you see Versions button in the toolbar while editing that category?

I use default Joomla 4 installation, and version history is enabled by default, so I don't know why it is not available for your test site.

avatar ceford
ceford - comment - 30 Mar 2021

Content -> Categories -> + then follow instructions. No Toolbar Versions label before first save. Same occurs for Contact -> Categories -> New. This is a Multi-Lingual test site! I am using Eclipse with Git to Pull and Merge the latest changes.


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

avatar Quy
Quy - comment - 30 Mar 2021

Column 'created_by_alias' cannot be null

Installed Testing Sample Data.
Edit Popular Tags article.
Click Versions button.
Click the only entry.
Click Restore button.

Column 'cid' cannot be null

Edit a banner.

avatar joomdonation joomdonation - change - 2 Apr 2021
The description was changed
avatar joomdonation joomdonation - edited - 2 Apr 2021
avatar joomdonation
joomdonation - comment - 2 Apr 2021

@Quy Could you please test it again? This should work and not depend on workflow enabled/disabled.

avatar alikon alikon - test_item - 2 Apr 2021 - Tested successfully
avatar alikon
alikon - comment - 2 Apr 2021

I have tested this item successfully on 7fce052


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

avatar richard67 richard67 - alter_testresult - 2 Apr 2021 - alikon: Tested successfully
avatar richard67
richard67 - comment - 2 Apr 2021

I've restored the previous test result in the issue tracker since the change which has invalidated the test was just a change in a comment.

avatar Quy Quy - test_item - 2 Apr 2021 - Tested successfully
avatar Quy
Quy - comment - 2 Apr 2021

I have tested this item successfully on bfc50f5


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

avatar Quy Quy - change - 2 Apr 2021
Status Pending Ready to Commit
avatar Quy
Quy - comment - 2 Apr 2021

RTC


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

avatar PhilETaylor
PhilETaylor - comment - 2 Apr 2021

This solution looks much better than the initial one! Great work!

avatar richard67 richard67 - close - 9 Apr 2021
avatar richard67 richard67 - merge - 9 Apr 2021
avatar richard67 richard67 - change - 9 Apr 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-04-09 17:01:29
Closed_By richard67
Labels Added: ?
avatar richard67
richard67 - comment - 9 Apr 2021

Thanks!

Add a Comment

Login with GitHub to post a comment