Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-7054

ModuleConfigurationObservingManager does not reload when observed node itself is deleted

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Neutral
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Template:
    • Story Points:
      8

      Description

      When using info.magnolia.cms.util.ModuleConfigurationObservingManager (or info.magnolia.cms.util.WorkspaceObservingManager) and registering specific paths to be observed no reload (#reload() occurs when the observed node itself is deleted.

      From the jcr documentation (also see javax.jcr.observation.ObservationManager#addEventListener(EventListener, int, String absPath, boolean isDeep, String[], String[], boolean)):

      12.5.3.4.1 Location
      [...]
      If isDeep is true, only events whose associated parent node is at or below absPath will be received.

      Thus only events will be triggered for direct child nodes of absPath (i.e. the observed path).

      Possible solution

      Register an additional observer for the parent of the actual path but for javax.jcr.observation.Event#NODE_REMOVED event types only. Additional "filtering" would have to happen too.

      Please find attached a test case for info.magnolia.observation.WorkspaceEventListenerRegistrationTest that shows the limitation (see #listenToDeletionOfRegisteredPathItself()).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              pmundt Philip Mundt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: