jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/336667 )
Change subject: Pass revision id to parseSectionsData to avoid warnings ...................................................................... Pass revision id to parseSectionsData to avoid warnings Bug: T157515 Change-Id: I5f666c569a2615daa580f049ac00ff70602d709a --- M includes/api/ApiMobileView.php 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Bmansurov: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php index f312757..5fcf8ff 100644 --- a/includes/api/ApiMobileView.php +++ b/includes/api/ApiMobileView.php @@ -476,6 +476,8 @@ * @param Title $title * @param ParserOutput $parserOutput * @param boolean $useTidy whether the provided HTML should be tidied (optional) + * @param integer $revId this is a temporary parameter to avoid debug log warnings. + * Long term the call to wfDebugLog should be moved outside this method (optional) * @return array structure representing the list of sections and their properties: * - refsections: [] where all keys are section ids of sections with refs * that contain references @@ -484,7 +486,7 @@ * or of length 1 when there is a mismatch. */ protected function parseSectionsData( $html, Title $title, ParserOutput $parserOutput, - $useTidy = false + $useTidy = false, $revId = null ) { $data = []; $data['sections'] = $parserOutput->getSections(); @@ -496,7 +498,7 @@ $chunks = preg_split( '/<h(?=[1-6]\b)/i', $html ); if ( count( $chunks ) != count( $data['sections'] ) + 1 ) { wfDebugLog( 'mobile', __METHOD__ . "(): mismatching number of " . - "sections from parser and split on page {$title->getPrefixedText()}, oldid=$latest" ); + "sections from parser and split on page {$title->getPrefixedText()}, oldid=$revId" ); // We can't be sure about anything here, return all page HTML as one big section $chunks = [ $html ]; $data['sections'] = []; @@ -624,7 +626,7 @@ ]; } else { $data = $this->parseSectionsData( $html, $title, $parserOutput, - $mfConfig->get( 'MFTidyMobileViewSections' ) && $this->getConfig()->get( 'UseTidy' ) ); + $mfConfig->get( 'MFTidyMobileViewSections' ) && $this->getConfig()->get( 'UseTidy' ), $latest ); if ( $this->usePageImages ) { $image = $this->getPageImage( $title ); if ( $image ) { -- To view, visit https://gerrit.wikimedia.org/r/336667 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5f666c569a2615daa580f049ac00ff70602d709a Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Bmansurov <bmansu...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits