Details
-
Improvement
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
-
None
-
Magnolia DX Core 6.2.13
Description
Steps to reproduce
- Write a custom Command in a Groovy script.
Example:
package example.commands; import info.magnolia.commands.impl.BaseRepositoryCommand; import info.magnolia.context.Context; public class ExampleCustomCommand extends BaseRepositoryCommand { @Override public boolean execute(Context ctx) { println "TEST"; return true; } }
- Add the Command to an existing module, e.g. "publishing-core" under a new Catalog with any name.
- Whitelist the Command in the "rest-services" module to enable access via the Commands v2 API.
- Test your script via the Commands v2 API endpoint to ensure it works.
- Update your Groovy script (e.g. make it print something else).
- Test your script again via the Commands v2 API endpoint.
Expected results
The saved changes to the Groovy script are reflected when executing the custom Command via the Commands v2 API endpoint.
Actual results
The OLD version of the Groovy script is executed. The saved changes are not reflected in the Groovy script.
Workaround
In the "Config" app, rename the Command to something arbitrary inside the module's "commands" node, and then rename it back to the original name.
This forces the module to reload. The saved changes in the Groovy script are now reflected in the Commands v2 API endpoint.
Comments
Magnolia usually does a pretty good job of updating itself so that changes to files are reflected immediately - especially with light modules.
This is the first time Magnolia didn't behave as expected and it unfortunately wasted so much of my time this week. Please get it looked at.
BR,
Niclas Horstad