jenkins-bot has submitted this change and it was merged.
Change subject: Only add tracking categories to "real" file pages
......................................................................
Only add tracking categories to "real" file pages
The file namespace also contains:
* File redirect
* Random pages that have no business being there
* Local pages with additional details from foreign files
None of which should be in the tracking category.
Change-Id: I9a6f4fa5bccc1a4ff875103b1ad95dae65f23074
Follow-up: bef043790e23c04b6
---
M HookHandler.php
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Gergő Tisza: Looks good to me, approved
jenkins-bot: Verified
diff --git a/HookHandler.php b/HookHandler.php
index 84f235a..40e7ea6 100755
--- a/HookHandler.php
+++ b/HookHandler.php
@@ -2,7 +2,7 @@
namespace CommonsMetadata;
-use Language;
+use Language, RepoGroup;
/**
* Hook handler
@@ -98,6 +98,7 @@
!$wgCommonsMetadataSetTrackingCategories
|| !$title->inNamespace( NS_FILE )
|| $content->getModel() !== CONTENT_MODEL_WIKITEXT
+ || !RepoGroup::singleton()->getLocalRepo()->findFile(
$title, array( 'ignoreRedirect' => true ) )
) {
return true;
}
--
To view, visit https://gerrit.wikimedia.org/r/165591
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9a6f4fa5bccc1a4ff875103b1ad95dae65f23074
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommonsMetadata
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits