Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/95481


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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateData 
refs/changes/81/95481/1

diff --git a/TemplateData.hooks.php b/TemplateData.hooks.php
index 25d2921..51d28cc 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: newchange
Gerrit-Change-Id: I0782ea669b431697d6c76be945c93d3e2f30f3cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TemplateData
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

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

Reply via email to