Legoktm has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/363656 )
Change subject: Keep track of what is disabling the TOC
......................................................................
Keep track of what is disabling the TOC
Bug: T168040
Change-Id: Id899115a0d69b01d7c02351a8dc672ed51f251a0
---
M includes/parser/ParserCache.php
M includes/parser/ParserOutput.php
2 files changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/56/363656/1
diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php
index 8b5683d..236f6fb 100644
--- a/includes/parser/ParserCache.php
+++ b/includes/parser/ParserCache.php
@@ -329,6 +329,7 @@
'parserOutputKey' => $parserOutputKey,
'timestamp' => $cacheTime,
'revid' => $revId,
+ 'disabler' => isset(
$parserOutput->mTOCDisabler ) ? $parserOutput->mTOCDisabler : false,
] );
}
diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index 10ac192..751c694 100644
--- a/includes/parser/ParserOutput.php
+++ b/includes/parser/ParserOutput.php
@@ -217,6 +217,8 @@
/** @var integer Upper bound of expiry based on parse duration */
private $mMaxAdaptiveExpiry = INF;
+ public $mTOCDisabler = null;
+
const EDITSECTION_REGEX =
'#<(?:mw:)?editsection page="(.*?)"
section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#s';
@@ -463,6 +465,9 @@
}
public function setTOCEnabled( $flag ) {
+ if ( $flag === false ) {
+ $this->mTOCDisabler = wfGetAllCallers( false );
+ }
return wfSetVar( $this->mTOCEnabled, $flag );
}
--
To view, visit https://gerrit.wikimedia.org/r/363656
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id899115a0d69b01d7c02351a8dc672ed51f251a0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.30.0-wmf.7
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits