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

ModuleConfigurationObservingManager does not reload when observed node itself is deleted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • None
    • core
    • None

      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()).

        Acceptance criteria

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

                Created:
                Updated:

                  Bug DoR
                  Task DoD