Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
I18n 2.0.2
-
None
Description
If a sling:Message with e.g. sling:key = "List of a rootpage's childpages" is defined, the org.apache.sling.jcr.resource.internal.JcrResourceResolver.queryResources(JcrResourceResolver.java:234) class will fail with a lexical query error due to the apostrophe in this case:
resulting query:
//element(,mix:language)[@jcr:language='en_US']/[@sling:key='Liste of a rootpage's childpages']/@sling:message
resulting exception:
rror while generating JSON componet list org.apache.sling.api.resource.QuerySyntaxException: Lexical error at line 1, column 133. Encountered: <EOF> after : "\']/@sling:message return $v": Lexical error at line 1, column 133. Encountered: <EOF> after : "\']/@sling:message return $v"
at org.apache.sling.jcr.resource.internal.JcrResourceResolver.queryResources(JcrResourceResolver.java:234)
at org.apache.sling.i18n.impl.JcrResourceBundle.loadResource(JcrResourceBundle.java:147)
at org.apache.sling.i18n.impl.JcrResourceBundle.handleGetObject(JcrResourceBundle.java:96)
at java.util.ResourceBundle.getObject(ResourceBundle.java:319)
at java.util.ResourceBundle.getString(ResourceBundle.java:285)
(...)
should the natural language approach be the way to go, probably special characters should be allowed (escaped internally).