Skip to content
Snippets Groups Projects
Commit 92b068c0 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

1074245 AttributeUsage onValidation fix

parent a6362298
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
<siblings> <siblings>
<element>Attribute_entity</element> <element>Attribute_entity</element>
</siblings> </siblings>
<onValidation>%aditoprj%/entity/AttributeUsage_entity/onValidation.js</onValidation>
<recordContainer>db</recordContainer> <recordContainer>db</recordContainer>
<entityFields> <entityFields>
<entityProvider> <entityProvider>
......
...@@ -3,7 +3,8 @@ import("system.vars"); ...@@ -3,7 +3,8 @@ import("system.vars");
import("system.translate"); import("system.translate");
import("Entity_lib"); import("Entity_lib");
var maxCount = vars.get("local.value"); var minCount = vars.getString("$field.MIN_COUNT");
var maxCount = vars.get("$local.value");
if (maxCount) if (maxCount)
{ {
...@@ -12,4 +13,7 @@ if (maxCount) ...@@ -12,4 +13,7 @@ if (maxCount)
result.string(translate.text("Maximal count must be one or higher")); result.string(translate.text("Maximal count must be one or higher"));
else if (maxCount != Math.floor(maxCount)) else if (maxCount != Math.floor(maxCount))
result.string(translate.text("Maximal count has to be a whole number")); result.string(translate.text("Maximal count has to be a whole number"));
else if (minCount && minCount > maxCount)
result.string(translate.text("The minimal count can't be larger than the maximal count!"));
} }
import("system.translate");
import("system.vars");
import("system.result");
var minCount = vars.getString("$field.MIN_COUNT");
var maxCount = vars.getString("$field.MAX_COUNT");
if (minCount != "" && maxCount != "" && minCount > maxCount)
result.string(translate.text("The minimal count can't be larger than the maximal count!"));
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment