Uploaded image for project: 'Repository Tools'
  1. Repository Tools
  2. MGNLTOOLS-86

Purge versions of previously deleted content doesn't work since 5.5

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.9
    • Labels:
      None
    • Sprint:
      Saigon 106, Saigon 107
    • Story Points:
      3
    • Magnolia Release:
      5.6

      Description

      Since MAGNOLIA-6774 introduces new path's structure of version in magnolia-mgnlVersion workspace so info.magnolia.tools.commands.VersionStorePurgeCommand#purge has never reached (https://git.magnolia-cms.com/projects/ENTERPRISE/repos/tools/browse/src/main/java/info/magnolia/tools/commands/VersionStorePurgeCommand.java#110).

      Reason is mgnlVersion.getRootNode().getNodes() only get child of root node from magnolia-mgnlVersion workspace and those nodes alway invalid because of missing mix:versionable.
      More code details:

      Step to reproduce:

      • Create page with name 'test' in pages app
      • Publish that 'test' page
      • Check version of it is created in JCR-Browser app/magnolia-mgnlVersion
      • Open Groovy app
      • Run below script to delete 'test' page, note: the name of page (in my case 'test') need to change if you create a different name
      java.lang.String querySql2 = "select * from [mgnl:page] as t where name(t) = 'test'";
      java.lang.String queryWorkspace = "website";
       
      javax.jcr.NodeIterator nodeList = info.magnolia.cms.util.QueryUtil.search(queryWorkspace, querySql2, javax.jcr.query.Query.JCR_SQL2, "mgnl:page");
       
      println "Removing nodes :";
      while(nodeList.hasNext()) {
        javax.jcr.Node currNode = nodeList.nextNode();
        println "${currNode.path}";
        currNode.remove();
      }
       
      info.magnolia.context.MgnlContext.getJCRSession(queryWorkspace).save();
      println "Nodes removal finished";
      
      • Check the 'test' page is gone in Pages app
      • Open JCR-Browser app/magnolia-mgnlVersion and make sure that the all node related to version of 'test' from step 3 is still existed
      • Open Repository tools app and click purge version in magnolia-mgnlVersion
      • Open JCR-Browser app/magnolia-mgnlVersion again and check the node has mix:versionable or node name is uuid

      Expectation: Version of 'test' page is gone
      Observation: Version of 'test' page still exist

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                oanh.thai Oanh Thai Hoang
                Reporter:
                oanh.thai Oanh Thai Hoang
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2d
                  2d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1.5d Time Not Required
                  1.5d