XmlAction generates groovy class using the passed-in location argument.
XmlAction instance for each screen is initialized using the screen's @location
+ ".actions". @location can be any valid string including hyphens, dots or any
other characters. Using the same value for class generation by Groovy could be
error prone. I encountered this scenario when I had a screen with a hyphen in
it's location.
Will there be any downside if we sanitize the location argument received in
the constructor of XmlAction before sending it to
GroovyClassLoader(XmlAction.groovy:37, XmlAction.groovy:54). Or may be use the
other variant, i.e., GroovyClassLoader.parseClass(String text) so that we do
not need to worry about the Class Name at all. Do you foresee any impact in
other areas of moqui due to this change?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The solution used elsewhere (including screens, etc) is to clean up the name
before passing it along. It looks like this issue was present in 2 places in
XmlAction.groovy, and 1 place in GroovyScriptRunner.groovy.
This should be fixed in commit b90193b.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
XmlAction generates groovy class using the passed-in location argument.
XmlAction instance for each screen is initialized using the screen's @location
+ ".actions". @location can be any valid string including hyphens, dots or any
other characters. Using the same value for class generation by Groovy could be
error prone. I encountered this scenario when I had a screen with a hyphen in
it's location.
Will there be any downside if we sanitize the location argument received in
the constructor of XmlAction before sending it to
GroovyClassLoader(XmlAction.groovy:37, XmlAction.groovy:54). Or may be use the
other variant, i.e., GroovyClassLoader.parseClass(String text) so that we do
not need to worry about the Class Name at all. Do you foresee any impact in
other areas of moqui due to this change?
The solution used elsewhere (including screens, etc) is to clean up the name
before passing it along. It looks like this issue was present in 2 places in
XmlAction.groovy, and 1 place in GroovyScriptRunner.groovy.
This should be fixed in commit b90193b.