Uploaded image for project: 'Observation'
  1. Observation
  2. MGNLOBS-29

RestrictToNodeTypeEventListener looks for rep:root, not the configured node type, then returns null path warning

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0.2
    • 2.0.1
    • None
    • Yes

      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.

        Acceptance criteria

              fgrilli Federico Grilli
              ahietala Antti Hietala
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD