Henning Snater has uploaded a new change for review.
https://gerrit.wikimedia.org/r/93960
Change subject: Removed .toJSON() usage in wikibase.SnakList.getPropertyOrder
......................................................................
Removed .toJSON() usage in wikibase.SnakList.getPropertyOrder
(bug 56673)
Not calling .toJSON() prevents serializing each snak which triggers an Error if
the snak features an UnUnserialzableValue.
Change-Id: Ied888ac7e1962332b6915a36238094a6879b71de
---
M lib/resources/wikibase.datamodel/wikibase.SnakList.js
1 file changed, 7 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/60/93960/1
diff --git a/lib/resources/wikibase.datamodel/wikibase.SnakList.js
b/lib/resources/wikibase.datamodel/wikibase.SnakList.js
index 899cdbc..da7f544 100644
--- a/lib/resources/wikibase.datamodel/wikibase.SnakList.js
+++ b/lib/resources/wikibase.datamodel/wikibase.SnakList.js
@@ -221,11 +221,14 @@
* @return {string[]}
*/
getPropertyOrder: function() {
- var json = this.toJSON(),
- propertyIds = [];
+ var propertyIds = [];
- $.each( json, function( propertyId, snak ) {
- propertyIds.push( propertyId );
+ this.each( function( i, snak ) {
+ var propertyId = snak.getPropertyId();
+
+ if( $.inArray( propertyId, propertyIds ) === -1 ) {
+ propertyIds.push( propertyId );
+ }
} );
return propertyIds;
--
To view, visit https://gerrit.wikimedia.org/r/93960
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied888ac7e1962332b6915a36238094a6879b71de
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits