jenkins-bot has submitted this change and it was merged.

Change subject: Avoid extra parsing on edit
......................................................................


Avoid extra parsing on edit

bug: 57026
Change-Id: I0782ea669b431697d6c76be945c93d3e2f30f3cf
---
M TemplateData.hooks.php
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/TemplateData.hooks.php b/TemplateData.hooks.php
index 621f8a3..be5845c 100644
--- a/TemplateData.hooks.php
+++ b/TemplateData.hooks.php
@@ -50,7 +50,9 @@
                // right after this hook is ran) has guards that lazy-init and 
return early if called again
                // later by the real WikiPage.
 
-               $editInfo = $page->prepareContentForEdit( $content, null, 
$user, $serialisation_format = null );
+               // Specify format the same way the API and EditPage do to avoid 
extra parsing
+               $format = $content->getContentHandler()->getDefaultFormat();
+               $editInfo = $page->prepareContentForEdit( $content, null, 
$user, $format );
 
                if ( isset( $editInfo->output->ext_templatedata_status ) ) {
                        $validation = 
$editInfo->output->ext_templatedata_status;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0782ea669b431697d6c76be945c93d3e2f30f3cf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/TemplateData
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to