Runtime error executeQueryLocally

The latest version of Breeze seems to violate executeQueryLocally. For instance:

var query = new breeze.EntityQuery() .from("Items").where('id', '==', id); return manager.executeQueryLocally(query); 

The problem I am facing is in calling stringEquals in getPredicateFn .

In the case of the simple request above, trim() is called on id calling

5 does not have a trimming method

Exception

Here is the Breeze stringEquals string function:

  function stringEquals(a, b, lqco) { if (lqco.usesSql92CompliantStringComparison) { a = (a || "").trim(); b = (b || "").trim(); } if (!lqco.isCaseSensitive) { a = (a || "").toLowerCase(); b = (b || "").toLowerCase(); } return a == b; } 

Edit

id defined as int in the Items model and is numeric in JavaScript . Previously, the Breeze version did not execute stringEqual , so there was no attempt to trim a numeric number.

+4
source share
1 answer

Well, that should be fixed. Check v0.73.1. Breeze predicates will now perform type coercion when comparing values โ€‹โ€‹of different types (for example, strings and numbers).

+3
source

Source: https://habr.com/ru/post/1447631/


All Articles