You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Putting a variable of ${{myvar}} into the granite:hide attribute causes the dialog to fail to load, with a stack trace that looks like the following.
javax.el.ELException: Failed to parse the expression [${{hideLinkText}}]
at org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:146) [com.adobe.granite.ui.commons:5.10.36]
at org.apache.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:172) [com.adobe.granite.ui.commons:5.10.36]
at org.apache.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:218) [com.adobe.granite.ui.commons:5.10.36]
at org.apache.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:68)
at com.adobe.granite.ui.components.impl.el.ExpressionResolverImpl.resolve(ExpressionResolverImpl.java:128) [com.adobe.granite.ui.commons:5.10.36]
at com.adobe.granite.ui.components.ExpressionHelper.get(ExpressionHelper.java:144) [com.adobe.granite.ui.commons:5.10.36]
at com.adobe.granite.ui.components.ExpressionHelper.get(ExpressionHelper.java:123) [com.adobe.granite.ui.commons:5.10.36]
at com.adobe.granite.ui.components.ExpressionHelper.getBoolean(ExpressionHelper.java:83) [com.adobe.granite.ui.commons:5.10.36]
at com.adobe.granite.ui.components.FilteringResourceWrapper.isVisible(FilteringResourceWrapper.java:158) [com.adobe.granite.ui.commons:5.10.36]
at com.adobe.granite.ui.components.FilteringResourceWrapper.access$000(FilteringResourceWrapper.java:85) [com.adobe.granite.ui.commons:5.10.36]
at com.adobe.granite.ui.components.FilteringResourceWrapper$2.evaluate(FilteringResourceWrapper.java:115) [com.adobe.granite.ui.commons:5.10.36]
at com.adobe.granite.ui.components.FilteringResourceWrapper$2.evaluate(FilteringResourceWrapper.java:112) [com.adobe.granite.ui.commons:5.10.36]
at org.apache.commons.collections4.iterators.FilterIterator.setNextObject(FilterIterator.java:176) [org.apache.commons.commons-collections4:4.4.0]
at org.apache.commons.collections4.iterators.FilterIterator.hasNext(FilterIterator.java:86) [org.apache.commons.commons-collections4:4.4.0]
at org.apache.commons.collections4.iterators.TransformIterator.hasNext(TransformIterator.java:74) [org.apache.commons.commons-collections4:4.4.0]
at org.apache.commons.collections4.iterators.FilterIterator.setNextObject(FilterIterator.java:174) [org.apache.commons.commons-collections4:4.4.0]
at org.apache.commons.collections4.iterators.FilterIterator.hasNext(FilterIterator.java:86) [org.apache.commons.commons-collections4:4.4.0]
at org.apache.commons.collections4.iterators.TransformIterator.hasNext(TransformIterator.java:74) [org.apache.commons.commons-collections4:4.4.0]
at org.apache.commons.collections.iterators.FilterIterator.setNextObject(FilterIterator.java:183) [org.apache.commons.collections:3.2.2]
at org.apache.commons.collections.iterators.FilterIterator.hasNext(FilterIterator.java:94) [org.apache.commons.collections:3.2.2]
at org.apache.commons.collections.iterators.TransformIterator.hasNext(TransformIterator.java:76) [org.apache.commons.collections:3.2.2]
at org.apache.commons.collections4.iterators.ListIteratorWrapper.hasNext(ListIteratorWrapper.java:114) [org.apache.commons.commons-collections4:4.4.0]
at libs.granite.ui.components.foundation.layouts.container.container__002e__jsp._jspService(container__002e__jsp.java:145) [aem-precompiled-scripts:1.0.20240418]
It appears that the granite:hide attribute is evaluated prior to com.adobe.acs.commons.granite.ui.components.NamespacedTransformedResourceProvider#transformResourceWithNameSpacing getting a chance to transform the variables. I validated this in a debugger, where the function is not called at all for my field when a parameterized var is in granite:hide. I also hacked the value of granite:hide from NamespacedTransformedResourceProvider via the debugger with "true" and my field was still not hidden, further backing the theory that granite:hide is processed prior to NamespacedTransformedResourceProvider executing to transform variables.
Steps to Reproduce
Simply use a parameterized variable in a child dialog snippet within the granite:hide property of a dialog field.
Required Information
Expected Behavior
When I use the Parameterized Include feature (https://adobe-consulting-services.github.io/acs-aem-commons/features/parameterized-namespace-include/subpages/parameter-example.html) I expect to be able to use variables for the
granite:hide
property so that the parent dialog that is including a dialog snippet can signal to hide certain fields.Actual Behavior
Putting a variable of
${{myvar}}
into thegranite:hide
attribute causes the dialog to fail to load, with a stack trace that looks like the following.It appears that the
granite:hide
attribute is evaluated prior tocom.adobe.acs.commons.granite.ui.components.NamespacedTransformedResourceProvider#transformResourceWithNameSpacing
getting a chance to transform the variables. I validated this in a debugger, where the function is not called at all for my field when a parameterized var is ingranite:hide
. I also hacked the value ofgranite:hide
fromNamespacedTransformedResourceProvider
via the debugger with "true" and my field was still not hidden, further backing the theory thatgranite:hide
is processed prior toNamespacedTransformedResourceProvider
executing to transform variables.Steps to Reproduce
Simply use a parameterized variable in a child dialog snippet within the
granite:hide
property of a dialog field.cc: @niekraaijmakers
The text was updated successfully, but these errors were encountered: