-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 7.10
-
Sprint:nxFG 9.2.2, nxFG 9.2.3
-
Story Points:3
The removal of a document should be prevented if a live proxy pointing to it still exists.
This is similar to the prevention of removal for a version if a proxy pointing to it still exists, except that for live documents there are more removal cases to consider, due to cascading removals inside folders.
If a document is incorrectly removed while a proxy to it still exists, in the current codebase with VCS the next access to the proxy will throw:
java.lang.NullPointerException at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.newDocument(SQLSession.java:459) at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.newDocument(SQLSession.java:441) at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getChildren(SQLSession.java:550) at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.getChildren(SQLDocumentLive.java:528)
If an attempt is made to remove a live document while a proxy still points to it, a DocumentExistsException "Cannot remove <folderid>, subdocument <livedocid> is the target of proxy <proxyid>" is thrown (this was already the case for a direct removal, but is now generalized even if the document is in a deep folder hierarchy).