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

JcrResourceOrigin should not filter out resources which were marked as deleted


    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 5.4.3
    • 5.4.2
    • resource-loader
    • None
    • Basel 13
    • 1

      JcrResourceOrigin uses some simple logic to determine whether a jcr node is a valid resource/folder, and does not expose the nodes that do not follow this logic.

      Currently the following criteria is used:

      • a folder is a node with mgnl:folder node type or a root
      • a resource is everything that has a 'binary' sub-node or 'text' property

      However, when a node is deleted via info.magnolia.commands.impl.MarkNodeAsDeletedCommand the content (properties and sub-nodes) of the node is always erased, so the above criteria for resource stops working and resource marked as deleted disappears from the origin.

      As a solution it is proposed to make the resource filter criteria to be less strict: we assume that anything of type mgnl:content is at least a file (and => is eligible to be considered a resource). As it is mentioned in the linked issue - all the JCR resources should have mgnl:content as a primary type, so it is safe to make such an assumption.

        Acceptance criteria

              ilgun Ilgun Ilgun
              ilgun Ilgun Ilgun
              0 Vote for this issue
              2 Start watching this issue