Manual:Reverts/fr

Une annulation est (généralement parlant) une modification qui inverse les actions des autres éditeur. Dans ce processus une nouvelle version de la page est créée.

Cette page présente les différents types d'annulations pris en charge et reconnus par MediaWiki, principalement pour les développeurs. Elle décrit également la manière d'intégrer les extensions dotées de mécanismes liés à l'annulation et présents dans le noyau de MediaWiki.

Types d'annulation
Trois méthodes pour réaliser des annulations sont reconnues par MediaWiki.

Interface utilisateur
Les undo sont réalisés en utilisant le lien undo qui apparait dans l'historique des pages, l'affichage du diff, les listes des modifications récentes et autres.

Les liens undo pointent vers  avec les paramètres   et   précisant les modifications à annuler.


 * – ID de la dernière version à annuler.
 * – ID de la dernière version valide. La version suivante sera la première à être annulée.

Voir aussi :

API
Les annulations peuvent être réalisées en utilisant l'API ainsi :  avec les paramètres   et. Leur comportement est le même que dans.

Méchanisme
Toutes les versions de  (exclue) à   (incluse) sont annulées. essaie de fusionner l'inverse de ces modifications avec toutes les modifications qui suivent If that is not possible, a regular edit form is displayed and the edit is not counted as an undo.

After that, the edit form is displayed to the user, where the resulting content can be further modified.

Since version 1.36, if the user performs any modifications to the content before saving, the edit is not marked as an undo. Ceci est fait pour empêcher les utilisateurs de marquer les modifications arbiraires en tant qu'annulations.

Autres types de contenu
If your extension implements a new ContentHandler, it can override the  method in order to customize how undos are handled by your content type.

Interface utilisateur
Rollback can be performed using the rollback link that appears in page history, diff view, recent changes list and other places.

Rollback links point to  with additional parameters for ensuring the correct set of changes is being rolled back.

See also: Manual:Parameters to index.php#rollback

API
Rollbacks can be performed through API using. Leur comportement est le même que dans.

Méchanisme
Rollback reverts the last edits made by the last editor of the page. This is a commonly useful scenario when dealing with vandalism, as usually all changes made recently by one user should be reverted.

Annulation manuelle
L'annulation manuelle n'utilise aucun interface utilisateur particulier ni aucune API, car elle est réalisée automatiquement par le logiciel. Every time an edit is made, MediaWiki looks at a number of most recent revisions of the page (specified by, 15 by default) and looks for the most recent revision with matching content. If such a revision is found, the edit is marked as a "manual revert", i.e. an edit restoring the page to an exact previous state.

The feature can be disabled entirely by setting  to zero.

Balises d'annulation
By default every revision considered a revert by MediaWiki is marked with an appropriate change tag. Each of these tags can be individually disabled using the  configuration variable.


 * Undo:
 * Rollback:
 * Manual revert:

Since version 1.36 additional data about the revert is saved with each tag in the  field of the    table. The data is the EditResult object associated with the edit (see the next section), encoded as JSON.

Accès à l'information annulée dans les extensions
Version 1.35 introduced the class that is constructed when saving an edit. This object encapsulates information about the effects of the edit in the context of its page's history, most importantly:


 * whether the edit was a revert,
 * which revert method was used,
 * what is the "base" revision for this revert,
 * which revisions were reverted.

This object is passed to extensions using the PageSaveComplete hook.

Balise d'annulation
In version 1.36 a new change tag is introduced –  that is used to mark reverted edits.

Planification et exécution
The tag is applied in a job named  scheduled using the job queue. The job is added to the queue by DerivedPageDataUpdater after the edit is saved.

If your wiki has a busy job queue and you encounter significant delays between making reverts and the tag being applied, you may want to execute the job in a separate queue or prioritize it, depending on your setup. See Manual:Job queue for details.

Conditions d'exécution
The update will be scheduled after saving an edit if all of the following conditions are met:


 * The edit is a revert of any type recognized by MediaWiki. Voir la section Types d'annulation.
 * The number of reverted edits is less or equal to.
 * The reverting revision itself is not marked as reverted or deleted.
 * The edit is considered auto-approved, which can have different meanings depending on your setup:
 * If you have patrolling enabled on your wiki through the  configuration variable, auto-approval is equivalent to the edit being autopatrolled. Thus, only users with   user right will have their reverted tag applied right away.
 * If you have installed a content management extension such as FlaggedRevs it can tell MediaWiki if the edit is auto-approved. How exactly is this determined depends on the extension. (voir la section Intégration des extensions.)

If the reverted tag update is stopped by the patrol subsystem or an extension, it can be later rescheduled when the edit is approved by a different user. In case of patrolling, this happens when the edit is patrolled. See the next section for details on how to integrate with this feature in extensions.

Intégration de l'extension
Extensions that involve some kind of revision approval mechanism can hook into the reverted tag feature to let MediaWiki know when to perform the reverted tag update.

The first part of this is the BeforeRevertedTagUpdate hook. It is called before the update is scheduled and extensions can use this hook to prevent the update from running if the edit is not considered auto-approved and needs further review.

If the update was stopped, it can be later rescheduled by the extension using the  service.


 * Approving a revision :

FlaggedRevs
If you have installed the FlaggedRevs extension, the revert will be considered auto-approved if either:


 * FlaggedRevs is configured to not be used on the page.
 * The user has the  user right.
 * The edit is a self revert.
 * The edit is otherwise eligible to be autoreviewed.

If the revert was not auto-approved, it can be later approved by simply reviewing the edit.

Voir aussi

 * Manual:Rollback
 * m:Research:Revert