Menu

#429 Allow deletion of single revisions (e.g. for copyvios)

open
nobody
5
2004-03-02
2004-03-02
No

As discussed on the mailing list there is the problem
that we can only delete a complete article. This is not
useful if an "established" article is replaced by a
copyright violation. For the moment it would mean we
have to delete the complete article including the page
history. It would be useful if a sysop could delete a
single revision of the history to delete only the copyvio.
I sat down and did a short hack which lacks some
security checks and logging. You have to diff the
following files (or try it somehow else :-)

includes/PageHistory.php
84,85c84,85
< $s .= $this->historyLine(
<
$this->mArticle->getTimestamp(),
---
| $s .= $this->historyLine(
|
$this->mArticle->getTimestamp(),
89c89
< (
$this->mArticle->getMinorEdit() > 0 )
---
| (
$this->mArticle->getMinorEdit() > 0 )
188a189,190
| // Add a link to delete only this
revision of the page
history
| $dellink = $this->mSkin->makeKnownLink(
$artname, $cur,
"delold=($oid)");
192c194
< $s .= "({$curlink}) (!OLDID!{$oid}!)
$arbitrary . .";
---
| $s .= "({$curlink}) (!OLDID!{$oid}!)
($dellink)
$arbitrary . .

index.php:
88a89,91
| case "delold":
| $wgArticle->$action($oid);
| break;

includes/Article.php:
943a944,986
| function delold () {
| global $wgUser, $wgOut, $wgMessageCache;
|
| $fname = "Article::DeleteOld";
| wfDebug( "$fname\n" );
|
| if ( ( ! $wgUser->isSysop() ) ) {
| $wgOut->sysopRequired();
| return;
| }
| if ( wfReadOnly() ) {
| $wgOut->readOnlyPage();
| return;
| }
| /* The following is a suggestion to
store the deleted
copyvio in a seperate
| table named. I am not sure if this
is useful and of
course we could use
| the archive table for this. */
| /*
| $sql = "INSERT INTO copyvio
(cv_namespace,cv_title,cv_text," .
|
"cv_comment,cv_user,cv_user_text,cv_timestamp,cv_minor_edit,"
.
| "cv_flags) SELECT
old_namespace,old_title,old_text,old_comment," .
|
"old_user,old_user_text,old_timestamp,old_minor_edit,old_flags
" .
| "FROM old WHERE oid='{$oid}'";";
| wfQuery( $sql, DB_WRITE, $fname );
| */
| $sql = "DELETE FROM old WHERE
oid='{$oid}'";
| $wgOut->addHTML( "<p>" . $sql );
| //wfQuery( $sql, DB_WRITE, $fname );
|
| $wgOut->setPagetitle( wfMsg(
"actioncomplete" ) );
| $wgOut->setRobotpolicy(
"noindex,nofollow" );
|
| $sk = $wgUser->getSkin();
| $loglink = $sk->makeKnownLink(
$wgLang->getNsText(
| Namespace::getWikipedia() ) .
| ":" . wfMsg( "dellogpage" ), wfMsg(
"deletionlog" ) );
|
| $text = wfMsg( "deletedtext", $deleted,
$loglink );
|
| $wgOut->addHTML( "<p>" . $text );
| $wgOut->returnToMain( false );
| }
|

languages/Language.php
406d405
< "Allmessages" => "All system messages",
757a757
| "del" => "del",
1170a1171
| "deletedcopyvio" => "The old version of this article
has been deleted",

Discussion

  • Anonymous

    Anonymous - 2004-03-04

    Logged In: YES
    user_id=782280

    I rewrote the code and now it does the following:
    -needs confirmation by the sysop who makes the deletion
    -writes the deleted revision to the "archive" table and
    replaces the text of old_text with something like "This
    revision has been deleted". Additionally old_user_text is
    replaced by "deleted" and the link to the user is removed
    (todo: check the username during registration so that noone
    can register as "deleted")
    -adds an entry to the deletion log

    What is missing:
    -undeletion is not possible (and I have no idea how to
    implement this)

    I will upload the files (includes/PageHistory.php,
    includes/Article.php, languages/Language.php and
    languages/LanguageDE.php) immediately.

     
  • Anonymous

    Anonymous - 2004-03-04

    Article.php with possibility to remove single revisions

     
  • Anonymous

    Anonymous - 2004-03-04

    PageHistory.php with link to delete single revisions

     
  • Anonymous

    Anonymous - 2004-03-04

    text for the deletion of single revisions added

     
  • Anonymous

    Anonymous - 2004-03-04

    german text phrases for deletion of single revisions added

     
  • Nobody/Anonymous

    Logged In: NO

    As I mentioned in wikitech-l, this function will be very useful
    for Japanese Wikipedia, too, where many potential/ probable
    copyright violations are found in articles with many edits. I
    really hope the function will be introduced as soon as
    possible.

    We initially asked a developer to delete specific versions of
    those articles, but no deletion occured so far, after four
    months since the first such request. (That is, I believe, due
    the server restructuring and all other stuff that kept
    developers busy, raher than lack of concern, by the way.)

     
  • Nobody/Anonymous

    Logged In: NO

    The previous post is mine. I forgot to sign.

    I also noticed that this feature request satisfies the request
    here:

    http://sourceforge.net/tracker/index.php?
    func=detail&aid=816624&group_id=34373&atid=411195

    Tomos

     

Log in to post a comment.

MongoDB Logo MongoDB