? ? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
16 May 2018

Pull Request for Issue #20365 .

Summary of Changes

added the missed check

Testing Instructions

see #20365

Expected result

not able to delete a keep forever marked content history item

Actual result

able

avatar alikon alikon - open - 16 May 2018
avatar alikon alikon - change - 16 May 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 May 2018
Category Administration com_content com_contenthistory
avatar brianteeman
brianteeman - comment - 16 May 2018

If you select 5 items - one of which is flagged keep forever - then it prevents you from deleting them all. I expected it to delete 4 items

avatar alikon alikon - change - 16 May 2018
Labels Added: ?
avatar alikon
alikon - comment - 16 May 2018

should be better now, it deletes only what you can delete

21d6933 16 May 2018 avatar alikon cs
avatar Quy Quy - test_item - 16 May 2018 - Tested successfully
avatar Quy
Quy - comment - 16 May 2018

I have tested this item successfully on 21d6933


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

avatar ggppdk
ggppdk - comment - 16 May 2018

The keep for ever feature is not "prevent user deletion" thing

It is keep a version when it "ages" due to new versions created ...
aka prevent automatic deletion of it

That is why the "... forever" thing
otherwise it would have been called something else "Not deletable" or something

  • please see the description of the feature in the language strings

COM_CONTENTHISTORY_BUTTON_KEEP_TOGGLE_OFF="Select to allow this version to be deleted automatically according to the delete schedule."
COM_CONTENTHISTORY_BUTTON_KEEP_TOGGLE_ON="Select to prevent this version being deleted automatically."

There is nothing to be fixed

if you do this change
then you will also need to update language strings and any documentation written for the feature
and also rename the feature

avatar alikon
alikon - comment - 16 May 2018

this is outside of the scope of this silly pr, as for my understanding of this feature...
...but i'm open to different opinions...

avatar ggppdk
ggppdk - comment - 16 May 2018

I would have posted to the original issue #20365, but that is now closed

it is not the PR that is wrong, it is the original issue that was wrong

avatar alikon
alikon - comment - 16 May 2018

can you show me where/when this automatic deletion happens

avatar ggppdk
ggppdk - comment - 16 May 2018

When a new version is stored by store() method of ContentHistoryHelper

https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Helper/ContentHistoryHelper.php#L147-L163

there is a cleanup of old versions to enforce the limit of maximum versions kept

and it calls
public function deleteOldVersions($maxVersions)
of ContentHistory 's Table class

https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Table/ContentHistory.php#L179-L200

  • Inside it the "keep_forever" is checked and the versions having it are excluded from deletion
avatar peteruoi
peteruoi - comment - 16 May 2018

If you keep 5 versions and the first version is marked keep forever when the 6th version will come it will not delete the first one but the second one and the result will be still 5 versions stored.

avatar alikon
alikon - comment - 16 May 2018

ok sorry this keep_forever feature, then is not clear to me

avatar joomla-cms-bot joomla-cms-bot - close - 16 May 2018
avatar Quy Quy - change - 16 May 2018
Status Pending Expected Behaviour
Closed_Date 0000-00-00 00:00:00 2018-05-16 18:53:15
Closed_By Quy
avatar joomla-cms-bot
joomla-cms-bot - comment - 16 May 2018

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/20430

avatar Quy
Quy - comment - 16 May 2018

Closing as expected per Keep Forever tooltips:
Select to allow this version to be deleted automatically according to the delete schedule.
Select to prevent this version being deleted automatically.


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

avatar alikon
alikon - comment - 16 May 2018

are you so sure ?
then fine to me

avatar Quy
Quy - comment - 16 May 2018

@alikon I thought that too until reading the documentation further:

Maximum Versions. The maximum number of versions to store for an item. If an item is saved and the maximum number of versions has been reached, the oldest version will be deleted automatically. If set to 0, then versions will never be deleted automatically. Also, specific versions may be flagged as "Keep Forever" and will not be deleted automatically. Note that versions may be deleted manually using the Delete button in the Version History screen.

Keep On/Off. This button allows you to toggle on or off the Keep Forever feature for a version. Normally, the oldest version of an item will be deleted automatically when the maximum number of versions (set in the Options for the component) has been exceeded. If you set the Keep Forever property for a version, it will never be automatically deleted.

avatar brianteeman
brianteeman - comment - 16 May 2018

The current way keep forever works is that it wont be automatically deleted based on the number of revisions stored. However, and as originally reported, it seems perfectly reasonable to me that you also can not manually delete something marked as keep forever

avatar carlitorweb
carlitorweb - comment - 16 May 2018

IMO have sense this PR. Mark a version as "Keep Forever" is a way to prevent someone from mistakenly deleting a version that can not be deleted.

avatar Quy
Quy - comment - 16 May 2018

@brianteeman Please decide. I tried to reopen it and got this error:

422 RuntimeException
Invalid response from GitHub
avatar carlitorweb
carlitorweb - comment - 16 May 2018

I tried to reopen it and got this error

@Quy Maybe because the branch was deleted?

avatar brianteeman
brianteeman - comment - 16 May 2018

I can't reopen it as the branch is deleted

avatar Quy
Quy - comment - 16 May 2018

@alikon Please restore the deleted branch. Sorry I made a hasty decision. Thank you!

avatar ggppdk
ggppdk - comment - 17 May 2018

This PR was created to fix a bug
and as detailed explained,
there was no bug to be fixed in the first place

but since majority here, thinks to change existing design
you will also need to

  • update language strings and maybe rename the feature
  • update documention
  • add some message why the version was not deleted,

finally people using this so far will have a small surprise when trying to cleanup their keep forever versions because they want to mark some other as keep forever

avatar ggppdk
ggppdk - comment - 17 May 2018

And besides what i mentioned above,
you are not changing the behavior in com_content only

you are changing the behavior in all core and 3rd party extensions that use versions
maybe a confirmation when clicking the delete button would be better:

Some of the versions selected for deletion are marked as keep-forever, are you sure to delete them ?

avatar brianteeman
brianteeman - comment - 17 May 2018

@ggppdk I dont agree - keep forever should mean exactly that. No need to change the text at all

avatar ggppdk
ggppdk - comment - 17 May 2018

well about name, you are propably right, no need to change it
i said, maybe naming needs to be changed

but the description language strings and documentation need to be changed / updated
and the rest i said , do apply

avatar alikon
alikon - comment - 17 May 2018

restored
@Quy, no problem at all 😄

avatar joomla-cms-bot joomla-cms-bot - change - 18 May 2018
Status Needs Review New
Closed_Date 0000-00-00 00:00:00
avatar joomla-cms-bot joomla-cms-bot - change - 18 May 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - reopen - 18 May 2018
avatar Quy Quy - change - 18 May 2018
Status Expected Behaviour Needs Review
Closed_Date 2018-05-16 18:53:15
Closed_By Quy
avatar joomla-cms-bot
joomla-cms-bot - comment - 18 May 2018

Set to "open" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/20430

avatar Quy
Quy - comment - 18 May 2018

Reopening for further discussion.


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

avatar carlitorweb
carlitorweb - comment - 18 May 2018

Also, I think is good change this string COM_CONTENTHISTORY_BUTTON_DELETE_DESC describing that these types of versions cannot be eliminated

avatar brianteeman
brianteeman - comment - 21 May 2018

I have tested this item successfully on 21d6933


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

avatar brianteeman brianteeman - test_item - 21 May 2018 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Jun 2018

@Quy can you please Retest?

avatar carlitorweb
carlitorweb - comment - 16 Jun 2018

I did the test, just as have a CS, I not put the test result, waiting for that. I will do now, no problem

avatar carlitorweb carlitorweb - test_item - 16 Jun 2018 - Tested successfully
avatar carlitorweb
carlitorweb - comment - 16 Jun 2018

I have tested this item successfully on 21d6933


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Jun 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Jun 2018

Ready to Commit after 3 successful tests.

avatar alikon alikon - change - 16 Jun 2018
Labels Added: ?
avatar alikon
alikon - comment - 16 Jun 2018

sorry @carlitorweb i've losed your comment ...

avatar carlitorweb
carlitorweb - comment - 16 Jun 2018

No problem @alikon

avatar mbabker mbabker - change - 18 Jun 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-06-18 02:55:48
Closed_By mbabker
avatar mbabker mbabker - close - 18 Jun 2018
avatar mbabker mbabker - merge - 18 Jun 2018

Add a Comment

Login with GitHub to post a comment