wiki.techinc.nl/includes/diff/Hook/DifferenceEngineNewHeaderHook.php
DannyS712 7bd7d2a6c1 Remove hooks that use Revision objects
All hooks were previously hard deprecated
in 1.35. Affected hooks:
* ArticleRevisionUndeleted - use RevisionUndeleted
* ArticleRollbackComplete - use RollbackComplete
* DiffRevisionTools - use DiffTools
* DiffViewHeader - use DifferenceEngineViewHeader
* HistoryRevisionTools - use HistoryTools
* NewRevisionFromEditComplete - use RevisionFromEditComplete
* PageContentInsertComplete - use PageSaveComplete
* PageContentSaveComplete - use PageSaveComplete
* ParserFetchTemplate - use BeforeParserFetchTemplateRevisionRecord
* RevisionInsertComplete - use RevisionRecordInserted
* TitleMoveComplete - use PageMoveComplete
* TitleMoveCompleting - use PageMoveCompleting
* UndeleteShowRevision - no replacement

Includes a fix for setting the associated rev id
of page protections, which previously was only done
using $nullRevision which was a Revision object created
if any hooks needed it; those hooks were hard deprecated
and so for WMF prod the rev id was not being set.

Bug: T247143
Depends-On: Idfa345193ae99fb2f1c9a8f8d28d8d540a6e3d62
Change-Id: I519167f76a5a3c1f5410415b2721462a3dcc3ec8
2021-04-30 17:28:20 +00:00

43 lines
1.9 KiB
PHP

<?php
namespace MediaWiki\Diff\Hook;
use DifferenceEngine;
/**
* This is a hook handler interface, see docs/Hooks.md.
* Use the hook name "DifferenceEngineNewHeader" to register handlers implementing this interface.
*
* @stable to implement
* @ingroup Hooks
*/
interface DifferenceEngineNewHeaderHook {
/**
* Use this hook to change the $newHeader variable, which contains information about
* the new revision, such as the revision's author, whether the revision was marked
* as a minor edit or not, etc.
*
* @since 1.35
*
* @param DifferenceEngine $differenceEngine
* @param string &$newHeader String containing the various #mw-diff-otitle[1-5] divs, which
* include things like revision author info, revision comment, RevisionDelete link and more
* @param array $formattedRevisionTools Array containing revision tools, some of which may have
* been injected with the DiffTools hook
* @param string $nextlink String containing the link to the next revision (if any); also
* included in $newHeader
* @param string $rollback Rollback link to roll this revision back to the previous one, if any
* @param string $newminor String indicating if the new revision was marked as a minor edit
* @param bool $diffOnly Boolean parameter passed to DifferenceEngine#showDiffPage, indicating
* whether we should show just the diff; passed in as a query string parameter to
* the various URLs constructed here (i.e. $nextlink)
* @param string $rdel RevisionDelete link for the new revision, if the current user is allowed
* to use the RevisionDelete feature
* @param bool $unhide Boolean parameter indicating whether to show RevisionDeleted revisions
* @return bool|void True or no return value to continue or false to abort
*/
public function onDifferenceEngineNewHeader( $differenceEngine, &$newHeader,
$formattedRevisionTools, $nextlink, $rollback, $newminor, $diffOnly, $rdel,
$unhide
);
}