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

Publishing with subnodes fails when one of them is for deletion

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 1.0.8, 1.1.2
    • 1.0.7
    • None

      Timebox for investigation: 3 SP

      Description:

      When having a tree of nodes, for example pages, if we delete one of them and publish the whole tree (publish with subnodes), nodes processed after the deleted one won't be published but unpublished, which make it fail and appear as unpublished. Here's how to reproduce:

      • We have the following pages tree:

      • Delete pageToBeDeleted and modify titles from root page (remove it) and from sub3

      • Publish pageToBeDeleted including sub nodes. If we debug it we'll see that first page processed is the root, then pageToBeDeleted and the rest of the subtree, which means that changes in subtree won't be reflected (i.e. after the deletion

      • In the public instance we can see that, as expected, only changes in root and deleted page are there but not in the subtree:

       

      Setting log level to DEBUG in the public instance for info.magnolia.publishing.transactional.receiver.operation.jcr.JcrTransactionUnpublicationOperation we can see following traces:

      javax.jcr.ItemNotFoundException: 65fefc8b-18c3-4c1a-ad63-6564e0cec916
      ...
      Caused by: org.apache.jackrabbit.core.state.NoSuchItemStateException: 65fefc8b-18c3-4c1a-ad63-6564e0cec916
      

      This problem appears in info.magnolia.publishing.sender.AbstractSender.send(List<Node>, Rule, boolean) method, specifically in these lines (154-155):

      publication = publication && !NodeUtil.hasMixin(node, NodeTypes.Deleted.NAME);
      Optional<SendOperation> operation = publication ? getOperationByName(PUBLISH) : getOperationByName(UNPUBLISH);
      

      when any of the nodes is marked for deletion, publication will be always false for the next nodes, which will be traduced as an unpublish operation for all of them. Therefore, it ends up causing the exception shown above when trying to remove the node.

       

        Acceptance criteria

              apchelintcev Aleksandr Pchelintcev
              jayala Jonathan Ayala
              Nucleus
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD