/**
* Fix thumbnail files from 1.4 or before, with extreme prejudice
- * @TODO: do we still care about this? Perhaps a maintenance script
+ * @todo : do we still care about this? Perhaps a maintenance script
* can be made instead. Enabling this code results in a serious
* RTT regression for wikis without 404 handling.
*/
if ( !$props ) {
wfProfileIn( __METHOD__ . '-getProps' );
$props = $this->repo->getFileProps( $this->getVirtualUrl() );
- wfProfileOut( __METHOD__ . -'getProps' );
+ wfProfileOut( __METHOD__ . '-getProps' );
}
if ( $timestamp === false ) {
# Add the log entry
$log = new LogPage( 'upload' );
$action = $reupload ? 'overwrite' : 'upload';
- $log->addEntry( $action, $descTitle, $comment, array(), $user );
+ $logId = $log->addEntry( $action, $descTitle, $comment, array(), $user );
wfProfileIn( __METHOD__ . '-edit' );
if ( $descTitle->exists() ) {
wfRunHooks( 'NewRevisionFromEditComplete', array( $wikiPage, $nullRevision, $latest, $user ) );
$wikiPage->updateRevisionOn( $dbw, $nullRevision );
}
+ $dbw->update( 'logging', array( 'log_page' => $descTitle->getArticleID() ), array( 'log_id' => $logId ), __METHOD__ );
+
# Invalidate the cache for the description page
$descTitle->invalidateCache();
$descTitle->purgeSquid();
# New file; create the description page.
# There's already a log entry, so don't make a second RC entry
# Squid and file cache for the description page are purged by doEdit.
- $wikiPage->doEdit( $pageText, $comment, EDIT_NEW | EDIT_SUPPRESS_RC, false, $user );
+ $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__ );
+ }
}
wfProfileOut( __METHOD__ . '-edit' );
*/
function getDescriptionText() {
global $wgParser;
- $revision = Revision::newFromTitle( $this->title, false, Revision::AVOID_MASTER );
+ $revision = Revision::newFromTitle( $this->title, false, Revision::READ_NORMAL );
if ( !$revision ) return false;
$text = $revision->getText();
if ( !$text ) return false;