- # Squid and file cache for the description page are purged by doEdit.
- $status = $wikiPage->doEdit( $pageText, $comment, EDIT_NEW | EDIT_SUPPRESS_RC, false, $user );
-
- if ( isset( $status->value['revision'] ) ) {
- $dbw->update( 'logging', array( 'log_page' => $status->value['revision']->getPage() ), array( 'log_id' => $logId ), __METHOD__ );
+ # Squid and file cache for the description page are purged by doEditContent.
+ $content = ContentHandler::makeContent( $pageText, $descTitle );
+ $status = $wikiPage->doEditContent( $content, $comment, EDIT_NEW | EDIT_SUPPRESS_RC, false, $user );
+
+ if ( isset( $status->value['revision'] ) ) { // XXX; doEdit() uses a transaction
+ $dbw->begin();
+ $dbw->update( 'logging',
+ array( 'log_page' => $status->value['revision']->getPage() ),
+ array( 'log_id' => $logId ),
+ __METHOD__
+ );
+ $dbw->commit(); // commit before anything bad can happen