[MGNLOBS-29] RestrictToNodeTypeEventListener looks for rep:root, not the configured node type, then returns null path warning Created: 07/May/14  Updated: 27/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: Major
Reporter: Antti Hietala Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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   

RestrictToNodeTypeEventListener throws a "null path" warning when used with the example listener config sendMailOnPageChanges.

WARN  servation.commands.RestrictToNodeTypeEventListener: Returning null path as either node was null or actual node type [rep:root] is not equal to the configured type [mgnl:content].

The listener config only observes changes to page properties such as page name. It is fair to assume that users would expect it to also observe changes to areas and components. Editing an area or component should be considered a "page change" as the listener name implies.

Please fix either the listener class or the example config so that they work out of the box.

To reproduce:

  1. Install the Observation module to get the sendMailOnPageChange listener and set active=true.
  2. Import the mail template config and template script from (MGNLOBS-27)
  3. In command params, add repository=website (MGNLOBS-28), valid mailTo address and type=freemarker
  4. Add includeSubNodes=true
  5. Rename a page. The listener sends a notification but throws a "null path" warning.
  6. Edit an area or component. The listener fails to send a notification and throws a "null path" warning.

Possible solutions:

  1. Set nodeType=mgnl:page in the example listener. This eliminates the null path warning because the last node up the website tree is a page (home page).
  2. Change the RestrictToNodeTypeEventListener logic so that it stops the node type search before rep:root to avoid the error. Change the warning to something like "No change to the configured node type (node:type) was detected."

Whichever route you take, please add includeSubNodes=true to the sendMailOnPageChanges listener config so that edits to child pages are also detected.


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