Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
None
-
None
-
-
Empty show more show less
-
Saigon 106, Saigon 107
-
3
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:
- https://git.magnolia-cms.com/projects/ENTERPRISE/repos/tools/browse/src/main/java/info/magnolia/tools/commands/VersionStorePurgeCommand.java#92
- https://git.magnolia-cms.com/projects/ENTERPRISE/repos/tools/browse/src/main/java/info/magnolia/tools/commands/VersionStorePurgeCommand.java#102
- https://git.magnolia-cms.com/projects/ENTERPRISE/repos/tools/browse/src/main/java/info/magnolia/tools/commands/VersionStorePurgeCommand.java#166
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
Checklists
Attachments
Issue Links
- relates to
-
MGNLTOOLS-85 Remove uses of the Content API
-
- Closed
-
-
MGNLTOOLS-87 Remove empty folders in mgnlVersion workspace
-
- Accepted
-