Brian Wolff has uploaded a new change for review.
https://gerrit.wikimedia.org/r/165591
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(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommonsMetadata
refs/changes/91/165591/1
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: newchange
Gerrit-Change-Id: I9a6f4fa5bccc1a4ff875103b1ad95dae65f23074
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommonsMetadata
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits