Extension:Safe Delete

MediaWiki extensions manual
Safe Delete
Release status: unmaintained
Implementation Special page
Description Adds a user friendly special page that is displayed when a user attempts to delete a page in a given set of namespaces if there are any links to that page from other pages in that set of namespaces.
Author(s) Cindy Cicalese (cindy.cicalesetalk)
Latest version 1.2 (2015-09-25)
Compatibility policy Master maintains backward compatibility.
MediaWiki >= 1.35.0
Database changes No
License MIT License
Download
$SafeDeleteNamespaces
Translate the Safe Delete extension if it is available at translatewiki.net

The Safe Delete extension adds a user friendly special page that is displayed when a user attempts to delete a page in a given set of namespaces if there are any links to that page from other pages in that set of namespaces. This helps to prevent a user from deleting a page when there are links to it. The Delete link provided by the skin will be replaced with a link to Special:SafeDelete/<pagename>, where <pagename> is the name of the page to be deleted. If there are no links to the page in the given set of namespaces, there will be an immediate redirect to the real deletion page. Otherwise, the user will be presented with a list of pages that contain links to the given page.

Installation edit

  • Download and move the extracted SafeDelete folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SafeDelete
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'SafeDelete' );
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration parameters edit

Flag Default Description
$SafeDeleteNamespaces no default (mandatory) $SafeDeleteNamespaces is an array of namespace numbers that will be protected by this extension. Only pages in one of those namespaces will be routed through the Special:SafeDelete page. If you want this extension to function for all content namespaces, you can set $SafeDeleteNamespaces equal to $wgContentNamespaces. When neither $SafeDeleteSemantic or $SafeDeleteCargo are active, only links from pages in one of the namespaces included in $SafeDeleteNamespaces will prevent the deletion of the page.
$SafeDeleteSemantic false When $SafeDeleteSemantic is set to true, the extension instead looks for any Semantic MediaWiki properties pointing to the page. Those semantic properties are not restricted to those on pages specified in $SafeDeleteNamespaces.
$SafeDeleteCargo array() $SafeDeleteCargo is an array of arrays indicating the Cargo table/field pairs to be searched for links to the current page. Each row of the array has 2 or 3 values: the name of a Cargo table, the name of a field in that table, and an optional Boolean (default false) indicating if that field is multi-valued. If a match is found in the table, the _pageName column refers to the page that points to the current page. The Cargo fields are not restricted to those on pages specified in $SafeDeleteNamespaces.

Note: When neither $SafeDeleteSemantic nor $SafeDeleteCargo are set, this extension uses the pagelinks and redirect database tables to find links to the current page. $SafeDeleteSemantic nor $SafeDeleteCargo may both be specified to search both semantic properties and Cargo tables.

Release Notes edit

Version 1.2 edit

  • Added support for Cargo.