Extension:EditWarning

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
EditWarning

Release status:Extension status unmaintained

ImplementationTemplate:Extension#type Notify
DescriptionTemplate:Extension#description Displays a warning if user edits a page/section which is currently being edited.
Author(s)Template:Extension#username Thomas David (Nemphistalk)
Latest versionTemplate:Extension#version 0.4 (2011-10-28)
MediaWikiTemplate:Extension#mediawiki 1.16+
Database changesTemplate:Extension#needs-updatephp Yes
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
ParametersTemplate:Extension#parameters
  • $EditWarning_Timeout
  • $EditWarning_OnlyEditor
Hooks usedTemplate:Extension#hook
AlternateEdit
ArticleSave
UserLogout
ArticleViewHeader
OutputPageBeforeHTML

Translate the EditWarning extension if it is available at translatewiki.net

Check usage and version matrix.

The EditWarning extension displays a warning if user edits a page/section which is currently being edited.

On pages which are being edited by many users simultaneously edit conflicts can easily happen. This extension tries to avoid this problem by showing a warning message if the user edits a page that is being edited by other users at the same time. It's very similar to the MoinMoin Wiki warning with the difference that it doesn't lock the page.

Note Note: It's not recommended to use this extension if anonymous users are allowed to edit pages, because it ignores anonymous page edits.

I've written this extension for a MediaWiki installation I maintained some time ago. Because I don't maintain it anymore, this extension won't receive any further major improvements or features. Even bugfixes may take some time. Please be patient or send me a patch.

Installation[edit]

  • Download and place the file(s) in a directory called EditWarning in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/EditWarning/EditWarning.php";
  • Execute the following SQL statements in your database:
CREATE TABLE IF NOT EXISTS editwarning_locks (
  user_id int(10) unsigned NOT NULL,
  user_name varchar(255) NOT NULL,
  article_id int(10) unsigned NOT NULL,
  timestamp int(11) unsigned NOT NULL,
  section int(2) unsigned NOT NULL,
  KEY user_id (user_id),
  KEY article_id (article_id)
) ENGINE=InnoDB;

ALTER TABLE editwarning_locks
  ADD CONSTRAINT editwarning_locks_ibfk_1 FOREIGN KEY (user_id) REFERENCES user (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT editwarning_locks_ibfk_2 FOREIGN KEY (article_id) REFERENCES page (page_id) ON DELETE CASCADE ON UPDATE CASCADE;
  • Configure as required
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration[edit]

  • The default timeout is set to 10 minutes. If you want to change this setting, add this line to your LocalSettings.php (Note: The value is the number of minutes):
$EditWarning_Timeout = 5;
  • The extension hides everything except the editor area (see screenshots). If you don't like this behavior, add this line to your LocalSettings.php:
$EditWarning_OnlyEditor = "false";

Upgrade from 0.3[edit]

See the UPGRADE file.

Known Issues[edit]

  • The extension can only recognize the cancel of page editing if the user uses the "Cancel" button. Otherwise the warning will be showed until the timeout (default 10 minutes).

See also[edit]