jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393280 )

Change subject: Don't use ParserOutput::setTOCEnabled() to try to hide the toc
......................................................................


Don't use ParserOutput::setTOCEnabled() to try to hide the toc

It's being deprecated in MediaWiki core change Ied5fe1a61. Actually
remove the TOC from the HTML instead.

Change-Id: I9b082e37f19c8baa182b0583c7d70d692fafc16e
---
M includes/WikidataPageBanner.hooks.php
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/WikidataPageBanner.hooks.php 
b/includes/WikidataPageBanner.hooks.php
index ebd0480..990ef32 100644
--- a/includes/WikidataPageBanner.hooks.php
+++ b/includes/WikidataPageBanner.hooks.php
@@ -157,8 +157,12 @@
                                if ( strpos( $options['toc'], 'class="toc"' ) 
!== false ) {
                                        $options['toc'] = str_replace( 
'class="toc"', '', $options['toc'] );
                                }
-                               // disable default TOC
-                               $pOut->setTOCEnabled( false );
+                               // Remove default TOC
+                               $pOut->setRawText( preg_replace(
+                                       '#' . preg_quote( Parser::TOC_START, 
'#' ) . '.*?' . preg_quote( Parser::TOC_END, '#' ) . '#s',
+                                       '',
+                                       $pOut->getRawText()
+                               ) );
                        }
 
                        // set banner properties as an OutputPage property

-- 
To view, visit https://gerrit.wikimedia.org/r/393280
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b082e37f19c8baa182b0583c7d70d692fafc16e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikidataPageBanner
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to