[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_28]: Revert "Move NewPP limit report HTML comments to JS variable...
Bartosz Dziewoński has submitted this change and it was merged. Change subject: Revert "Move NewPP limit report HTML comments to JS variables" and followups .. Revert "Move NewPP limit report HTML comments to JS variables" and followups This change resulted in unreasonable feature loss (human-readable limit report was gone). Three months and multiple followups later, the functionality is still not completely restored. Given lack of response from the original author, I think it is time to revert and reconsider, especially since the 1.28 release is soon. A machine-readable limit report would be a very useful feature, but not at the cost of losing human-readable limit report. This reverts the following commits: * Move NewPP limit report HTML comments to JS variables b7c4c8717f964d1890d185ec3e6e9481fcb734e4 * Only pretty-print the parser report JS vars 28adc4d7eef2d7d8e5696a4f9849538a769daa00 * Show wgPageParseReport on page previews too 1255654ed5a89ed57491bda38f544ed87e3bc601 * Re-add human readable parser limit report 0051f108b954b52b9981d5d85862ac1f292db80c * Restore hooks.txt for ParserLimitReportFormat 4663e7a7371fabb96ed9c909e5b93042c5f08438 Resolved minor merge conflicts in OutputPage (with 80e5b160) and release notes. Bug: T110763 Bug: T142210 Change-Id: Id88c8066fae3f369e8977b4b7488f67071bdeeb7 (cherry picked from commit 0e15a6068a5a07fc109b5898ae51fdb8decafaf0) --- M RELEASE-NOTES-1.28 M includes/EditPage.php M includes/OutputPage.php M includes/parser/Parser.php M includes/parser/ParserOutput.php M includes/resourceloader/ResourceLoader.php 6 files changed, 65 insertions(+), 92 deletions(-) Approvals: Bartosz Dziewoński: Verified; Looks good to me, approved diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28 index d20dba0..7521cfa 100644 --- a/RELEASE-NOTES-1.28 +++ b/RELEASE-NOTES-1.28 @@ -209,7 +209,6 @@ * Skin::linkKnown() (use MediaWiki\Linker\LinkRenderer instead) * Skin::userLink() (use Linker::userLink() instead) * Skin::userToolLinks() (use Linker::userToolLinks() instead) -* The 'ParserLimitReportFormat' hook was removed. * Disabled "bug 2702" HTML tidying of parsed UI messages on wikis where Tidy is disabled. * DifferenceEngine::generateDiffBody() was removed (deprecated since 1.21). diff --git a/includes/EditPage.php b/includes/EditPage.php index 059af97..a9d1c48 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3559,22 +3559,16 @@ ] ) . Html::openElement( 'tbody' ); - foreach ( $output->getLimitReportData()['limitreport'] as $key => $value ) { + foreach ( $output->getLimitReportData() as $key => $value ) { if ( Hooks::run( 'ParserLimitReportFormat', [ $key, &$value, &$limitReport, true, true ] ) ) { - $keyMsg = wfMessage( "limitreport-$key" ); - $valueMsg = wfMessage( - [ "limitreport-$key-value-html", "limitreport-$key-value" ] - ); + $keyMsg = wfMessage( $key ); + $valueMsg = wfMessage( [ "$key-value-html", "$key-value" ] ); if ( !$valueMsg->exists() ) { $valueMsg = new RawMessage( '$1' ); } if ( !$keyMsg->isDisabled() && !$valueMsg->isDisabled() ) { - // If it's a value/limit array, convert it for $1/$2 - if ( is_array( $value ) && isset( $value['value'] ) ) { - $value = [ $value['value'], $value['limit'] ]; - } $limitReport .= Html::openElement( 'tr' ) . Html::rawElement( 'th', null, $keyMsg->parse() ) . Html::rawElement( 'td', null, $valueMsg->params( $value )->parse() ) . diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 863a426..a8be748 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -295,9 +295,6 @@ */ private $copyrightUrl; - /** @var array Profiling data */ - private $limitReportData = []; - /** * Constructor for OutputPage. This should not be called directly. * Instead a new RequestContext should be created and it will implicitly create @@ -1776,14 +1773,9 @@ } } - // Enable OOUI if requested via ParserOutput + // enable OOUI if requested via ParserOutput if ( $parserOutput->getEnableOOUI() ) {
[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_28]: Revert "Move NewPP limit report HTML comments to JS variable...
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/320522 Change subject: Revert "Move NewPP limit report HTML comments to JS variables" and followups .. Revert "Move NewPP limit report HTML comments to JS variables" and followups This change resulted in unreasonable feature loss (human-readable limit report was gone). Three months and multiple followups later, the functionality is still not completely restored. Given lack of response from the original author, I think it is time to revert and reconsider, especially since the 1.28 release is soon. A machine-readable limit report would be a very useful feature, but not at the cost of losing human-readable limit report. This reverts the following commits: * Move NewPP limit report HTML comments to JS variables b7c4c8717f964d1890d185ec3e6e9481fcb734e4 * Only pretty-print the parser report JS vars 28adc4d7eef2d7d8e5696a4f9849538a769daa00 * Show wgPageParseReport on page previews too 1255654ed5a89ed57491bda38f544ed87e3bc601 * Re-add human readable parser limit report 0051f108b954b52b9981d5d85862ac1f292db80c * Restore hooks.txt for ParserLimitReportFormat 4663e7a7371fabb96ed9c909e5b93042c5f08438 Resolved minor merge conflicts in OutputPage (with 80e5b160) and release notes. Bug: T110763 Bug: T142210 Change-Id: Id88c8066fae3f369e8977b4b7488f67071bdeeb7 (cherry picked from commit 0e15a6068a5a07fc109b5898ae51fdb8decafaf0) --- M RELEASE-NOTES-1.28 M includes/EditPage.php M includes/OutputPage.php M includes/parser/Parser.php M includes/parser/ParserOutput.php M includes/resourceloader/ResourceLoader.php 6 files changed, 65 insertions(+), 92 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/22/320522/1 diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28 index d20dba0..7521cfa 100644 --- a/RELEASE-NOTES-1.28 +++ b/RELEASE-NOTES-1.28 @@ -209,7 +209,6 @@ * Skin::linkKnown() (use MediaWiki\Linker\LinkRenderer instead) * Skin::userLink() (use Linker::userLink() instead) * Skin::userToolLinks() (use Linker::userToolLinks() instead) -* The 'ParserLimitReportFormat' hook was removed. * Disabled "bug 2702" HTML tidying of parsed UI messages on wikis where Tidy is disabled. * DifferenceEngine::generateDiffBody() was removed (deprecated since 1.21). diff --git a/includes/EditPage.php b/includes/EditPage.php index 059af97..a9d1c48 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3559,22 +3559,16 @@ ] ) . Html::openElement( 'tbody' ); - foreach ( $output->getLimitReportData()['limitreport'] as $key => $value ) { + foreach ( $output->getLimitReportData() as $key => $value ) { if ( Hooks::run( 'ParserLimitReportFormat', [ $key, &$value, &$limitReport, true, true ] ) ) { - $keyMsg = wfMessage( "limitreport-$key" ); - $valueMsg = wfMessage( - [ "limitreport-$key-value-html", "limitreport-$key-value" ] - ); + $keyMsg = wfMessage( $key ); + $valueMsg = wfMessage( [ "$key-value-html", "$key-value" ] ); if ( !$valueMsg->exists() ) { $valueMsg = new RawMessage( '$1' ); } if ( !$keyMsg->isDisabled() && !$valueMsg->isDisabled() ) { - // If it's a value/limit array, convert it for $1/$2 - if ( is_array( $value ) && isset( $value['value'] ) ) { - $value = [ $value['value'], $value['limit'] ]; - } $limitReport .= Html::openElement( 'tr' ) . Html::rawElement( 'th', null, $keyMsg->parse() ) . Html::rawElement( 'td', null, $valueMsg->params( $value )->parse() ) . diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 863a426..a8be748 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -295,9 +295,6 @@ */ private $copyrightUrl; - /** @var array Profiling data */ - private $limitReportData = []; - /** * Constructor for OutputPage. This should not be called directly. * Instead a new RequestContext should be created and it will implicitly create @@ -1776,14 +1773,9 @@ } } - // Enable OOUI if requested via ParserOutput + // enable OOUI if requested via ParserOutput if (