diff --git a/framework/build.gradle b/framework/build.gradle index 412da3dec..c6e643fb5 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -16,7 +16,7 @@ // tasks.withType(GroovyCompile) { options.compilerArgs << "-Xlint:unchecked" } // tasks.withType(GroovyCompile) { options.compilerArgs << "-Xlint:deprecation" } -version = '2.0.0-rc1' +version = '2.0.0-SNAPSHOT' apply plugin: 'groovy' apply plugin: 'war' diff --git a/framework/src/main/groovy/org/moqui/impl/screen/ScreenForm.groovy b/framework/src/main/groovy/org/moqui/impl/screen/ScreenForm.groovy index ca72f7c64..2859199bc 100644 --- a/framework/src/main/groovy/org/moqui/impl/screen/ScreenForm.groovy +++ b/framework/src/main/groovy/org/moqui/impl/screen/ScreenForm.groovy @@ -958,7 +958,7 @@ class ScreenForm { } } } else if ("option".equals(childNode.name)) { - String key = ec.resource.expand(childNode.attribute('key'), null) + String key = ec.resource.expandNoL10n(childNode.attribute('key'), null) String text = ec.resource.expand(childNode.attribute('text'), null) options.put(key, text ?: key) } @@ -978,7 +978,7 @@ class ScreenForm { String key = null String keyAttr = childNode.attribute('key') if (keyAttr != null && keyAttr.length() > 0) { - key = ec.resource.expand(keyAttr, null) + key = ec.resource.expandNoL10n(keyAttr, null) // we just did a string expand, if it evaluates to a literal "null" then there was no value if (key == "null") key = null } else if (listOptionEvb != null) { diff --git a/framework/src/main/groovy/org/moqui/impl/screen/ScreenRenderImpl.groovy b/framework/src/main/groovy/org/moqui/impl/screen/ScreenRenderImpl.groovy index d0d1566be..0d44b31d4 100644 --- a/framework/src/main/groovy/org/moqui/impl/screen/ScreenRenderImpl.groovy +++ b/framework/src/main/groovy/org/moqui/impl/screen/ScreenRenderImpl.groovy @@ -1184,10 +1184,8 @@ class ScreenRenderImpl implements ScreenRender { // NOTE: defaultValue is handled below so that for a plain string it is not run through expand Object obj = getFieldValue(fieldNodeWrapper, "") if (ObjectUtilities.isEmpty(obj) && defaultValue != null && defaultValue.length() > 0) - return ec.resourceFacade.expand(defaultValue, "") + return ec.resourceFacade.expandNoL10n(defaultValue, "") return ObjectUtilities.toPlainString(obj) - // NOTE: this approach causes problems with currency fields, but kills the string expand for default-value... a better approach? - //return obj ? obj.toString() : (defaultValue ? ec.getResource().expand(defaultValue, null) : "") } Object getFieldValue(MNode fieldNode, String defaultValue) { diff --git a/moqui-util/build.gradle b/moqui-util/build.gradle index d7d17e844..112e52529 100644 --- a/moqui-util/build.gradle +++ b/moqui-util/build.gradle @@ -14,7 +14,7 @@ // tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" } -version = '1.0.0-rc1' +version = '1.0.0-SNAPSHOT' apply plugin: 'java' // to run gradle-versions-plugin use "gradle dependencyUpdates" diff --git a/moqui-util/src/main/java/org/moqui/util/MNode.java b/moqui-util/src/main/java/org/moqui/util/MNode.java index af192eb52..98b670b77 100644 --- a/moqui-util/src/main/java/org/moqui/util/MNode.java +++ b/moqui-util/src/main/java/org/moqui/util/MNode.java @@ -763,7 +763,7 @@ public void endElement(String ns, String localName, String qName) { private static final FtlNodeListWrapper emptyNodeListWrapper = new FtlNodeListWrapper(new ArrayList<>(), null); private FtlNodeListWrapper allChildren = null; private ConcurrentHashMap attrAndChildrenByName = null; - private Set knownNullAttributes = null; + private ConcurrentHashMap knownNullAttributes = null; public Object getAdaptedObject(Class aClass) { return this; } @@ -775,7 +775,7 @@ public void endElement(String ns, String localName, String qName) { TemplateModel attrOrChildWrapper = attrAndChildrenByName.get(s); if (attrOrChildWrapper != null) return attrOrChildWrapper; } - if (knownNullAttributes != null && knownNullAttributes.contains(s)) return null; + if (knownNullAttributes != null && knownNullAttributes.containsKey(s)) return null; // at this point we got a null value but attributes and child nodes were pre-loaded so return null or empty list if (s.startsWith("@")) { @@ -790,8 +790,8 @@ public void endElement(String ns, String localName, String qName) { String attrName = s.substring(1, s.length()); String attrValue = attributeMap.get(attrName); if (attrValue == null) { - if (knownNullAttributes == null) knownNullAttributes = new HashSet<>(); - knownNullAttributes.add(s); + if (knownNullAttributes == null) knownNullAttributes = new ConcurrentHashMap<>(); + knownNullAttributes.put(s, Boolean.TRUE); return null; } else { FtlAttributeWrapper attrWrapper = new FtlAttributeWrapper(attrName, attrValue, this);