The rule action of "a node is moved" is receiving null locale

  Written by The Jahia Team
 
Developers
   Estimated reading time:
7.1.2.5

executeActionNow works in different JCR session depending on the node move context: 

  • Drag&Drop -> JCR session contains the locale 
  • Cut&Paste -> System JCR session doesn't contain the locale 
     

Cause

The code path for Drag&Drop and Cut&Paste are not the same and are not executed in the same context.

Solution

If you can work in only one language in your action, you can force the locale on the node you receive in the action by adding: 

node = JCRSessionFactory.getInstance().getCurrentUserSession(null,new Locale("en")).getNode(node.getPath());