diff --git a/entity/DescriptionTranslation_entity/entityfields/lang/displayValueProcess.js b/entity/DescriptionTranslation_entity/entityfields/lang/displayValueProcess.js index ff765a8a0746cb7cfffd5a566889016a882118c5..2c0eaf3fa384b6ccc1f87dd6cb4d1ef45f7d6c73 100644 --- a/entity/DescriptionTranslation_entity/entityfields/lang/displayValueProcess.js +++ b/entity/DescriptionTranslation_entity/entityfields/lang/displayValueProcess.js @@ -1,11 +1,8 @@ -import("system.db"); import("system.translate"); -import("system.vars"); import("system.result"); -import("KeywordRegistry_basic"); -import("Keyword_lib"); import("Sql_lib"); -result.string(translate.text(new SqlBuilder().select("NAME_LATIN ").from("AB_LANGUAGE") - .where().andPrepareVars("AB_LANGUAGE.ISO3", "$field.LANG") - .cell())); \ No newline at end of file +result.string(translate.text(newSelect("NAME_LATIN") + .from("AB_LANGUAGE") + .whereIfSet("AB_LANGUAGE.ISO3", "$field.LANG") + .cell(true))); \ No newline at end of file diff --git a/entity/Language_entity/recordcontainers/db/conditionProcess.js b/entity/Language_entity/recordcontainers/db/conditionProcess.js index 4443829786305824cd33baacb99826236c68377c..9e0e3a69ce20255f94f5f90179b9dbc93ac2c006 100644 --- a/entity/Language_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Language_entity/recordcontainers/db/conditionProcess.js @@ -7,7 +7,7 @@ var cond = newWhere() if (vars.getString("$param.ExcludedIds_param")) { - cond.and("AB_LANGUAGE.ISO3", JSON.parse(vars.getString("$param.ExcludedIds_param")), SqlBuilder.NOT_IN()) + cond.andIfSet("AB_LANGUAGE.ISO3", JSON.parse(vars.getString("$param.ExcludedIds_param")), SqlBuilder.NOT_IN()) } //TODO: use a preparedCondition (.build instead of .toString) when available #1030812 #1034026 diff --git a/process/Product_lib/process.js b/process/Product_lib/process.js index 0504e216b85d4eab167b1fa81a7f0bc7806b3751..1c7f91318e380e29494e92336d82c25677160a6c 100644 --- a/process/Product_lib/process.js +++ b/process/Product_lib/process.js @@ -210,8 +210,9 @@ ProductUtils.getProductDetails = function(pid, priceListFilter, additionalProduc this.join(pJoin[1], pJoin[3], pJoin[2], pJoin[0]); }, productDataSql) - var ProductData = productDataSql.orderBy(orderby) - .and("PRODUCT.PRODUCTID", pid) + var ProductData = productDataSql + .where("PRODUCT.PRODUCTID", pid) + .orderBy(orderby) .table(); for (var i = 0; i < ProductData.length; i++)