Brian Wolff has uploaded a new change for review.
https://gerrit.wikimedia.org/r/69269
Change subject: Make rc_cur_id have proper value for upload log entries.
......................................................................
Make rc_cur_id have proper value for upload log entries.
Primary motivation here is to make Special:Recentchangelinked work
correctly for uploads where the description page doesn't exist yet.
(Previously it was mostly only showing reupload log entries)
Mild downside to this approach is adding the recentchanges row is
now in a different commit...
Change-Id: I74c68b972c47c03066d3065e3748769a27a654fb
---
M RELEASE-NOTES-1.22
M includes/filerepo/file/LocalFile.php
2 files changed, 12 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/69/69269/1
diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index 1b434d9..e98ed8e 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -150,6 +150,7 @@
'pageid', 'page', 'title', and 'text' (e.g. if only passed 'summary'). A
warning will instead be issued if 'title' is non-default, unless no props are
requested.
+* Special:Recentchangeslinked will now include upload log entries
=== API changes in 1.22 ===
* (bug 46626) xmldoublequote parameter was removed. Because of a bug, the
diff --git a/includes/filerepo/file/LocalFile.php
b/includes/filerepo/file/LocalFile.php
index b21b87a..4a2f692 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -1294,11 +1294,16 @@
// creation, page doesn't exist yet, so log_page = 0
// but we want it to point to the page we're making,
// so we later modify the log entry.
+ // For a similar reason, we avoid making an RC entry
+ // now and wait until the page exists.
$logId = $logEntry->insert();
- $logEntry->publish( $logId );
- wfProfileIn( __METHOD__ . '-edit' );
$exists = $descTitle->exists();
+ if ( $exists ) {
+ // Page exists, do RC entry now (otherwise we wait for
later).
+ $logEntry->publish( $logId );
+ }
+ wfProfileIn( __METHOD__ . '-edit' );
if ( $exists ) {
# Create a null revision
@@ -1343,9 +1348,13 @@
array( 'log_id' => $logId ),
__METHOD__
);
+ // Now that the page exists, make an RC entry.
+ $logEntry->publish( $logId );
$dbw->commit( __METHOD__ ); // commit before
anything bad can happen
}
}
+
+
wfProfileOut( __METHOD__ . '-edit' );
# Save to cache and purge the squid
--
To view, visit https://gerrit.wikimedia.org/r/69269
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I74c68b972c47c03066d3065e3748769a27a654fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits