Subramanya Sastry has uploaded a new change for review.
https://gerrit.wikimedia.org/r/235403
Change subject: Batcher: Always pass width/height in imageinfo requests
......................................................................
Batcher: Always pass width/height in imageinfo requests
* The batching API returns an error without this.
Try the following (with and without this patch)
$ echo '[[File:Foobar.jpg|x120px|caption]]' | node parse
$ echo '[[File:Foobar.jpg|x120px|caption]]' | node parse --useBatchAPI
* Found by investigating 'Error: Invalid result when expanding template batch'
on 'enwiki:Dwarf planet' page which was consistently reproducible
Wikitext of the form above was found on that page which
was tripping up the batching api.
Change-Id: Iccc8851240730c79d41134f0aefc9cc51f3cd445
---
M lib/mediawiki.Batcher.js
1 file changed, 4 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/03/235403/1
diff --git a/lib/mediawiki.Batcher.js b/lib/mediawiki.Batcher.js
index 15eae28..409ef35 100644
--- a/lib/mediawiki.Batcher.js
+++ b/lib/mediawiki.Batcher.js
@@ -232,13 +232,10 @@
hash: hash,
};
if (dims.width !== null || dims.height !== null) {
- params.txopts = {};
- if (dims.width !== null) {
- params.txopts.width = dims.width;
- }
- if (dims.height !== null) {
- params.txopts.height = dims.height;
- }
+ params.txopts = {
+ width: dims.width || 0,
+ height: dims.height || 0,
+ };
}
this.pushGeneric(params, cb);
--
To view, visit https://gerrit.wikimedia.org/r/235403
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iccc8851240730c79d41134f0aefc9cc51f3cd445
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits