* @deprecated since 1.21, getContent() should be used instead.
*/
public function getText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
- ContentHandler::deprecated( __METHOD__, '1.21' );
+ wfDeprecated( __METHOD__, '1.21' );
$this->loadLastEdit();
if ( $this->mLastRevision ) {
* @deprecated since 1.21: use doEditContent() instead.
*/
public function doEdit( $text, $summary, $flags = 0, $baseRevId = false, $user = null ) {
- ContentHandler::deprecated( __METHOD__, '1.21' );
+ wfDeprecated( __METHOD__, '1.21' );
$content = ContentHandler::makeContent( $text, $this->getTitle() );
* @param bool $u2 Unused
* @param array|string &$error Array of errors to append to
* @param User $user The deleting user
+ * @param array $tags Tags to apply to the deletion action
* @return Status Status object; if successful, $status->value is the log_id of the
* deletion log entry. If the page couldn't be deleted because it wasn't
* found, $status is a non-fatal 'cannotdelete' error
*/
public function doDeleteArticleReal(
- $reason, $suppress = false, $u1 = null, $u2 = null, &$error = '', User $user = null
+ $reason, $suppress = false, $u1 = null, $u2 = null, &$error = '', User $user = null,
+ $tags = []
) {
global $wgUser, $wgContentHandlerUseDB;
// Now that it's safely backed up, delete it
$dbw->delete( 'page', [ 'page_id' => $id ], __METHOD__ );
-
- if ( !$dbw->cascadingDeletes() ) {
- $dbw->delete( 'revision', [ 'rev_page' => $id ], __METHOD__ );
- }
+ $dbw->delete( 'revision', [ 'rev_page' => $id ], __METHOD__ );
// Log the deletion, if the page was suppressed, put it in the suppression log instead
$logtype = $suppress ? 'suppress' : 'delete';
$logEntry->setPerformer( $user );
$logEntry->setTarget( $logTitle );
$logEntry->setComment( $reason );
+ $logEntry->setTags( $tags );
$logid = $logEntry->insert();
- $dbw->onTransactionPreCommitOrIdle( function () use ( $dbw, $logEntry, $logid ) {
- // Bug 56776: avoid deadlocks (especially from FileDeleteForm)
- $logEntry->publish( $logid );
- } );
+ $dbw->onTransactionPreCommitOrIdle(
+ function () use ( $dbw, $logEntry, $logid ) {
+ // Bug 56776: avoid deadlocks (especially from FileDeleteForm)
+ $logEntry->publish( $logid );
+ },
+ __METHOD__
+ );
$dbw->endAtomic( __METHOD__ );
$dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select( 'categorylinks',
[ 'cl_to AS page_title, ' . NS_CATEGORY . ' AS page_namespace' ],
- // Have to do that since DatabaseBase::fieldNamesWithAlias treats numeric indexes
+ // Have to do that since Database::fieldNamesWithAlias treats numeric indexes
// as not being aliases, and NS_CATEGORY is numeric
[ 'cl_from' => $id ],
__METHOD__ );
// NOTE: stub for backwards-compatibility. assumes the given text is
// wikitext. will break horribly if it isn't.
- ContentHandler::deprecated( __METHOD__, '1.21' );
+ wfDeprecated( __METHOD__, '1.21' );
$handler = ContentHandler::getForModelID( CONTENT_MODEL_WIKITEXT );
$oldContent = is_null( $oldtext ) ? null : $handler->unserializeContent( $oldtext );
$cat->refreshCounts();
}
}
- }
+ },
+ __METHOD__
);
}
*
* @param Content|null $content Optional Content object for determining the
* necessary updates.
- * @return DataUpdate[]
+ * @return DeferrableUpdate[]
*/
public function getDeletionUpdates( Content $content = null ) {
if ( !$content ) {