Uploaded image for project: 'Publishing'
  1. Publishing
  2. PUBLISHING-49

Publishing inconsistently runs in different contexts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Neutral
    • None
    • None
    • None

    Description

      
      private List<Node> collect(Node toPublish, Context ctx) throws RepositoryException {
         List<Node> result = new ArrayList<>();
      
         if (isRecursive()) {
           if (getVersionMap() != null) {
              result = collectFromVersionMap(versionMap, ctx); //system context(BaseVersionManager#getVersionedNode(javax.jcr.Node))
           } else {
             result = collectRecursively(toPublish); //user context (info.magnolia.jcr.util.NodeUtil#getNodes(javax.jcr.Node, org.apache.jackrabbit.commons.predicate.Predicate))
           }
         } else {
           if (StringUtils.isNotEmpty(getVersion())) {
            toPublish = versionManager.getVersion(toPublish, getVersion());  //system context(BaseVersionManager#getVersionedNode(javax.jcr.Node))
          }
          result.add(toPublish); //system context (from info.magnolia.commands.impl.BaseRepositoryCommand#getJCRNode)
         }
         return result;
      }
      
      

      info.magnolia.publishing.sender.DefaultSender#updateMetaData then differentiates between system and user context JCR sessions, but in some cases this is the same session.
      Publications started form workflow run always in system context so maybe the differentiating (= not running everything in the system context) just make things more complicated.
      The behaviour should be consistent no matter of recursive flag (ideally the same behaviour as in the legacy activation module).

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                rkovarik Roman Kovařík
                Nucleus
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD