Page MenuHomePhabricator

Show *how many* prior revisions exist when deleting an article
Closed, ResolvedPublic

Description

If an administrator deletes an article with versions he gets a hint: "Be
carful, there are versions".

In many cases it would be helpful if he gets the infomation HOW MANY versions
exist.

Example:

A user creates a nonsense article with contents "aabbccdd". Another user edits
this article to vote for deletion. Now this article has 2 versions.

If I want to delete this article and I get the info "2 versions", I can hit
the "ok-button". If there are more than 2 versions I must look into the history
because a previous version may have excellent contents.

Without the info about the number of versions I always must chck the history.


Version: unspecified
Severity: enhancement

Details

Reference
bz3480

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:48 PM
bzimport set Reference to bz3480.
bzimport added a subscriber: Unknown Object (MLST).

rowan.collins wrote:

One problem with this from a technical point of view would be the database load
required to count all the edits an article has had if there are many. Perhaps it
could be "2", "3", "more than 3" or similar...

[PS: Please try to summarise the bug/request in the "summary" field, not just
the activity it relates to]

Ok, to reduce the database load it would be sufficient to tell me if
there are more than 2 versions or not.

jaymac407 wrote:

patch

Attached:

jaymac407 wrote:

attached my first ever patch. I'm so proud. xD

jaymac407 wrote:

Comment on attachment 5456
patch

Index: includes/Article.php

  • includes/Article.php (revision 42453)

+++ includes/Article.php (working copy)
@@ -2146,6 +2146,7 @@

  1. Hack for big sites $bigHistory = $this->isBigDeletion();

+ $revisions = $this->estimateRevisionCount();

		if( $bigHistory && !$this->mTitle->userCan( 'bigdelete' ) ) {
			global $wgLang, $wgDeleteRevisionsLimit;
			$wgOut->wrapWikiMsg( "<div class='error'>\n$1</div>\n",

@@ -2177,6 +2178,9 @@

					array( 'delete-warning-toobig', $wgLang->formatNum( $wgDeleteRevisionsLimit ) ) );
			}
		}

+ if( $revisions > 3 && !$confirm ) {
+ $wgOut->wrapWikiMsg(''.wfMsg('revdelete-count', $revisions).'');
+ }

		return $this->confirmDelete( $reason );
	}

Index: languages/messages/MessagesEn.php

  • languages/messages/MessagesEn.php (revision 42453)

+++ languages/messages/MessagesEn.php (working copy)
@@ -1314,6 +1314,7 @@
'revdelete-unhid' => 'unhid $1',
'revdelete-log-message' => '$1 for $2 {{PLURAL:$2|revision|revisions}}',
'logdelete-log-message' => '$1 for $2 {{PLURAL:$2|event|events}}',
+'revdelete-count' => 'The article currently has $1 edits worth of history, deleting the article will also remove that history.',

  1. Suppression log 'suppressionlog' => 'Suppression log',

Fixed in r58087 by adding the count in MediaWiki:Historywarning.