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

Version events fired in all workspaces


    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 5.7.9, 6.2.4
    • 5.7.8, 6.2.3
    • None
    • Yes
    • Maintenance 24, Maintenance 25, Maintenance 26
    • 13

      When a page or asset is versioned a node added event occurs in all workspaces. The versions can be visually inspected from the JCR Browser:

      Set true: /modules/jcr-browser-app/apps/jcr-browser/subApps/browser/contentConnector@includeSystemNodes

      This screenshots one example of a page version and one example of an asset version:
      Page in messages wksp

      Asset in messages wksp

      New versions should not effect the observation mechanism of every workspace.

      Actual Result
      A node added event is fired in every workspace.

      To see the issue create this groovy script in the package structure info.magnolia.test:
      import: scripts.info.xml

      package info.magnolia.test;
      import javax.jcr.observation.*;
      import javax.jcr.RepositoryException;
      import javax.jcr.observation.Event;
      import info.magnolia.observation.*;
      import org.slf4j.Logger;
      import org.slf4j.LoggerFactory;
      public class NodeAddedEvent implements EventListener {
          private static final Logger log = LoggerFactory.getLogger(NodeAddedEvent.class);
          private String workspace = "";
          public NodeAddedEvent(String workspace) {
              log.info("Worksapce listener registered: {}", workspace);
              this.workspace = workspace;
          public void onEvent(EventIterator events) {
              while (events.hasNext()) {
                  Event event = events.nextEvent();
              if (event.getType() == Event.NODE_ADDED)
                  try {
                      log.info("Node added to {}: {}", workspace, event.getPath());
                  } catch (RepositoryException e) {
      workspaces = [
          "advancedCache", "campaigns", "category",
          "config", "dam", "imaging", "keystore",
          "marketing-tags", "messages", "magnolia-mgnlSystem",
          "magnolia-mgnlVersion", "personas", "profiles", "rankings", "resources",
          "rss", "scripts", "segments", "stories", "tags", "tasks",
          "usergroups", "userroles", "users", "visitors", "website", "workflow"
      for (workspace : workspaces) {
          println workspace;
              .observe(workspace, "/", new NodeAddedEvent(workspace))

      Create a page and publish it. The NodeAddedEvent will log every new node created. page-node-creation-and-publish.log


      • Each time you add a new workspace to the system you are creating additional drag on the versioning system.
      • Since the versions can be seen from every workspace you must be careful when iterating the nodes of a workspace. Most likely you do not want to iterate the system level nodes.

        Acceptance criteria

              fgrilli Federico Grilli
              rgange Richard Gange
              0 Vote for this issue
              3 Start watching this issue


                  Bug DoR
                  Task DoD

                    Original Estimate - Not Specified
                    Not Specified
                    Remaining Estimate - 0d
                    Time Spent - 0.25d