'RevisionInsertComplete': called after a revision is inserted into the DB
$revision: the Revision
$edit: was this a new edit?
+$baseID: what revision ID was this revision based off? (false if none)
'SavePreferences': called at the end of PreferencesForm::savePreferences;
returning false prevents the preferences from being saved.
* EDIT_NEW is specified and the article does exist, a duplicate key error will cause an exception
* to be thrown from the Database. These two conditions are also possible with auto-detection due
* to MediaWiki's performance-optimised locking strategy.
+ * @param integer $baseRevID, the revision ID this is based off
*
* @return bool success
*/
- function doEdit( $text, $summary, $flags = 0 ) {
+ function doEdit( $text, $summary, $flags = 0, $baseRevID = false ) {
global $wgUser, $wgDBtransactions;
wfProfileIn( __METHOD__ );
) );
$dbw->begin();
- $revisionId = $revision->insertOn( $dbw, true );
+ $revisionId = $revision->insertOn( $dbw, true, $baseRevID );
# Update page
$ok = $this->updateRevisionOn( $dbw, $revision, $lastRevision );
if( $bot && ($wgUser->isAllowed('markbotedits') || $wgUser->isAllowed('bot')) )
$flags |= EDIT_FORCE_BOT;
- $this->doEdit( $target->getText(), $summary, $flags );
+ $this->doEdit( $target->getText(), $summary, $flags, $target->getId() );
wfRunHooks( 'ArticleRollbackComplete', array( $this, $wgUser, $target ) );
*
* @param Database $dbw
* @param bool $edit, was this a new edit? (optional)
+ * @param integer $baseID, what revision was this based on? (optional)
* @return int
*/
- public function insertOn( &$dbw, $edit=false ) {
+ public function insertOn( &$dbw, $edit = false, $baseID = false ) {
global $wgDefaultExternalStore;
wfProfileIn( __METHOD__ );
$this->mId = !is_null($rev_id) ? $rev_id : $dbw->insertId();
- wfRunHooks( 'RevisionInsertComplete', array( &$this, $edit ) );
+ wfRunHooks( 'RevisionInsertComplete', array( &$this, $edit, $baseID ) );
wfProfileOut( __METHOD__ );
return $this->mId;