MediaWiki talk:Wdsearch-autodesc.js: Difference between revisions
Content deleted Content added
→Please ignore claims marked with deprecated rank: change the diff to link to the version that actually filters the array |
|||
Line 125:
{{editprotected}}
: [[Special:Diff/756970705|Diff/756970705]] should do the trick. Can anyone apply it and test it, please? <span style="font-family:Segoe Script">[[User:Petr Matas|Petr Matas]]</span> 00:16, 28 December 2016 (UTC)
:: {{ping|Petr Matas}} I spotted two things which I think are bugs in the filterClaims function. The first is the $.each syntax - the first parameter to the callback function is the array index, not the value. The second is the use of $.grep in a loop. According to the [http://api.jquery.com/jquery.grep/ docs], this function alters the existing array. It would work fine on the first iteration if there are any preferred statements, but as the original values array is altered, on the second iteration $.grep would be working with an empty array (it has no preferred statements, and any normal or deprecated statements were removed in the first iteration). I've fixed both of these bugs in [[Special:Diff/
== Language selection bugfix ==
|