[MGNLOBS-28] Repository property required in two places for command listeners Created: 06/May/14  Updated: 16/May/14  Resolved: 16/May/14

Status: Closed
Project: Observation
Component/s: None
Affects Version/s: 2.0.1
Fix Version/s: 2.0.2

Type: Bug Priority: Critical
Reporter: Antti Hietala Assignee: Federico Grilli
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: XML File config.modules.observation.config.listenerConfigurations.activateAddedPages.xml    
Issue Links:
causality
caused by MGNLOBS-26 NPE on running command triggered by e... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Testcase included:
Yes

 Description   

Per MGNLOBS-26 the repository property is only needed as a command parameter. However, the system expects to find it in two places: under the listener and as command parameter.

To reproduce:

  1. Import the attached activateAddedPages listener.
  2. Delete the repository property from /modules/observation/config/listenerConfigurations/activateAddedPages/listener/params/repository.
  3. In the Pages app, add a new site root page.
  4. Result: error 1.
  5. Add the property back to command parameters but delete it from /modules/observation/config/listenerConfigurations/activateAddedPages/repository
  6. In the Pages app, add a new site root page.
  7. Result: no error is thrown but the page is not activated.

Error 1:

DEBUG a.module.observation.commands.CommandEventListener: Checking event for command info.magnolia.module.activation.commands.ActivationCommand invocation
DEBUG a.module.observation.commands.CommandEventListener: Command params are {}
DEBUG a.module.observation.commands.CommandEventListener: Path is /test8
DEBUG nolia.module.activation.commands.ActivationCommand: Will activate content from null repository with uuid null and path /test8
ERROR a.module.observation.commands.CommandEventListener: can't execute command 
java.lang.NullPointerException


 Comments   
Comment by Antti Hietala [ 16/May/14 ]

This is how it works. The repository property is mandatory for a listener to be register. For command listeners it may be also required as a parameter for the command. No code change needed, update documentation.

Generated at Mon Feb 12 10:23:20 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.