WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 10 months ago

#9681 new feature request

Add hooks to allow a plugin to support the deletion of unneeded revisions

Reported by: Denis-de-Bernardy Owned by:
Milestone: Future Release Priority: low
Severity: minor Version: 2.8
Component: Revisions Keywords: need-patch
Focuses: Cc:

Description

There currently is a means to restore a revision, but no means to delete one.

Attachments (3)

9681.patch (2.4 KB) - added by hakre 5 years ago.
9681.2.patch (2.1 KB) - added by hakre 5 years ago.
9681.diff (1.2 KB) - added by Denis-de-Bernardy 5 years ago.

Download all attachments as: .zip

Change History (29)

comment:1 Denis-de-Bernardy5 years ago

  • Keywords needs-patch added

hakre5 years ago

comment:2 hakre5 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 2.8

Looks like this was only forgotten, there was a message called stub in the code and most functionaly already provided with the restore action.

comment:3 follow-up: DD325 years ago

  • Milestone changed from 2.8 to Future Release

The original intention was to leave all revision-management to a plugin, to let the community decide and develop what was needed, and to eventually integrate the best one out there with Core.

Revision management is something thats needed, But I'm not sure just implementing the delete functionality is a good idea.

I'm moving this to a Future release, Mearly based upon the idea that adding something full blown should be done instead (And its a feature request) - Of course, A committer could come along in a minute and commit it anyway..

That aside, Comments on the patch: Just because revisions are disabled, doesnt mean to say that revisions shouldnt be deleted.

comment:4 in reply to: ↑ 3 ; follow-up: hakre5 years ago

Replying to DD32:

That aside, Comments on the patch: Just because revisions are disabled, doesnt mean to say that revisions shouldnt be deleted.

same for restoring a revision?

comment:5 hakre5 years ago

Some other thought: If you wanna do that by Plugin with a plugable interface: fine (very fine). But that means a change for the restoring action as well. This Patch really is small and oriented to the existing code, so that I do not really see a problem to have it in and to replace it in a further release with a better thought concept.

+1 for having the small patch in for now.

comment:6 Denis-de-Bernardy5 years ago

  • Keywords needs-testing 2nd-opinion added

comment:7 follow-up: DD325 years ago

  • Keywords dev-feedback added

same for restoring a revision?

Nah, Revisions are disabled, therefor, let them restore any that for some reason, are available.

I think i included a delete option on Revision Control (WP Plugin of mine) - It needs a rewrite, I was planning on something with a better fledged UI.. havnt gotten around to it.

I guess you're right, a minimal patch would be ok, might kick others into making more plugins or suggestions.

I hate to say it, but i do think it has to wait for 2.9, I hate having to draw a line in the sand between which enhancements should be added after a near-feature-freeze (But i dont think we're there yet officially?)

comment:8 in reply to: ↑ 7 Denis-de-Bernardy5 years ago

Replying to DD32:

I hate to say it, but i do think it has to wait for 2.9, I hate having to draw a line in the sand between which enhancements should be added after a near-feature-freeze (But i dont think we're there yet officially?)

dev blog said we were a few weeks back. and then loads of features got tossed in, so...

personally, I'd rather see 2.8 get released in july with all known bugs closed, or nearly so, rather than rushed next month to meet an artificial deadline.

comment:9 in reply to: ↑ 4 hakre5 years ago

Replying to DD32:

same for restoring a revision?

Nah, Revisions are disabled, therefor, let them restore any that for some reason, are available.

just aside comment to the patch: delete action has taken over the same checks then revert action. if you do like to have the revert action available if revisions are disabled, then the trunk must be patched for that. i have just taken over the same piece of code for deleting than it is available for reverting.

comment:10 Denis-de-Bernardy5 years ago

patch works fine, but we might want to add some kind of js confirmation

comment:11 Denis-de-Bernardy5 years ago

  • Keywords tested added; needs-testing 2nd-opinion removed

comment:12 Denis-de-Bernardy5 years ago

  • Milestone changed from Future Release to 2.9

comment:13 Denis-de-Bernardy5 years ago

  • Keywords dev-feedback removed

still applies clean. would be nice if this got committed or rejected before it's stale.

comment:14 westi5 years ago

  • Keywords needs-patch added; has-patch tested removed

This is broken as is.

I get notices for undefined vars on delete - h2 and right_checked

There is not user-experience feedback on the action.

comment:15 follow-up: hakre5 years ago

@westi:

Do you not get notices for undefined vars on restore?

Do you not get a user-experience feddback on the restore-action?

comment:16 in reply to: ↑ 15 westi5 years ago

Replying to hakre:

@westi:

Do you not get notices for undefined vars on restore?

Nope

Do you not get a user-experience feddback on the restore-action?

Yes - it redirects back to the post edit page and you get a message at the top.

e.g. - Post restored to revision from 20 December, 2005 @ 10:50

hakre5 years ago

comment:17 hakre5 years ago

  • Keywords has-patch added; needs-patch removed

I updated the patch, it now gives feedback to the user that and which revision has been deleted.

there should be no warnings about undefined variables.

comment:18 follow-up: azaozz5 years ago

Deleting revisions has some security/management implications for multi-user blogs. It breaks the audit trail. Don't think we need any support for that in core even if it doesn't have an UI.

If another hook is needed to allow plugins to implement it easier, lets add it.

comment:19 in reply to: ↑ 18 westi5 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.9 to Future Release
  • Summary changed from Add a button to allow the deletion of unneeded revisions to Add hooks to allow a plugin to support the deletion of unneeded revisions

Replying to azaozz:

Deleting revisions has some security/management implications for multi-user blogs. It breaks the audit trail. Don't think we need any support for that in core even if it doesn't have an UI.

If another hook is needed to allow plugins to implement it easier, lets add it.

Agreed.

If someone wants to cook up a patch for wp_list_post_revisions() to add the required hooks and put together a demo plugin to test with then I will happily commit the required hooks.

Moving to Future for now until that patch exists.

Denis-de-Bernardy5 years ago

comment:20 Denis-de-Bernardy5 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 3.0

comment:21 westi5 years ago

Not sure the current patch will enable all of it to happen easily in a plugin.

Do we not need a hook in revision.php to make it easy to implement delete?

Also I'm not sure we have an easy obvious hook for handling unknown message ids?

comment:22 Denis-de-Bernardy5 years ago

  • Keywords need-patch added; has-patch removed

k... I guess this'll wait for a better patch then, and a sample plugin.

comment:23 miqrogroove4 years ago

  • Milestone changed from 3.0 to Future Release

comment:24 westi18 months ago

  • Keywords revisions-3.6 added

Adding to the list to consider for the 3.6 revisions work.

comment:25 westi18 months ago

  • Keywords revisions-3.6 removed

For now we are keeping this out of the 3.6 list

Note: See TracTickets for help on using tickets.