aboutsummaryrefslogtreecommitdiffstats
path: root/includes/skins/Skin.php
diff options
context:
space:
mode:
authorJon Robson <jdlrobson@gmail.com>2025-02-12 13:25:32 -0800
committerJdlrobson <jdlrobson@gmail.com>2025-02-12 23:04:25 +0000
commitb6ec26002d8a9a7d2c924fbe076221ffefc57309 (patch)
tree727dc4358684e667168d0d5936e311749da014dc /includes/skins/Skin.php
parent0b1656af6319c18a51e044653c45c2df33b7f1be (diff)
downloadmediawikicore-b6ec26002d8a9a7d2c924fbe076221ffefc57309.tar.gz
mediawikicore-b6ec26002d8a9a7d2c924fbe076221ffefc57309.zip
Limit Codex logging to action and special pages
We've fixed enough issues that we can be begin limiting this logging to special pages and action items. In future once the remaining issues are addressed we can promote this to production warning logs. Bug: T375287 Change-Id: I9cca758d17f6dc0e32651d4b7a1583a8088b2bf3
Diffstat (limited to 'includes/skins/Skin.php')
-rw-r--r--includes/skins/Skin.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php
index b317fc914cd1..5b8c79b965df 100644
--- a/includes/skins/Skin.php
+++ b/includes/skins/Skin.php
@@ -509,6 +509,10 @@ abstract class Skin extends ContextSource {
if ( strpos( $out->getHTML(), 'mw-message-box' ) !== false ) {
$modules['styles']['content'][] = 'mediawiki.legacy.messageBox';
}
+
+ $action = $this->getRequest()->getRawVal( 'action' ) ?? 'view';
+ $title = $this->getTitle();
+ $namespace = $title ? $title->getNamespace() : -1;
// If the page is using Codex message box markup load Codex styles.
// Since 1.41. Skins can unset this if they prefer to handle this via other
// means.
@@ -523,7 +527,9 @@ abstract class Skin extends ContextSource {
return strpos( $module, 'codex' ) !== false;
} );
if ( !$codexModules ) {
- $logger->warning( 'Page uses Codex markup without appropriate style pack.' );
+ if ( $action === 'view' || $namespace === NS_SPECIAL ) {
+ $logger->warning( 'Page uses Codex markup without appropriate style pack.' );
+ }
$modules['styles']['content'][] = 'mediawiki.codex.messagebox.styles';
}
}
@@ -557,7 +563,7 @@ abstract class Skin extends ContextSource {
$modules['styles']['user'][] = 'mediawiki.tempUserBanner.styles';
}
- if ( $this->getTitle() && $this->getTitle()->getNamespace() === NS_FILE ) {
+ if ( $namespace === NS_FILE ) {
$modules['styles']['core'][] = 'filepage'; // local Filepage.css, T31277, T356505
}