Deleting a version decrease quota list count
Hi,
I use nuxeo-quota in Nuxeo 6.0-HF05 and I noticed this :
When I delete a old version of a live document (in History Tab), the number of documents in the parent folder is decreased.
I think this is not expected as the live document is still present. Is there a simple way to fix this behavior ?
Thanks.
0 votes
3 answers
2071 views
Hello I could fix this issue by extending the class DocumentsCountUpdater and overiding the following method :
@Override
protected void processDocumentAboutToBeRemoved(CoreSession session, DocumentModel doc, DocumentEventContext docCtx) throws ClientException {
List<DocumentModel> ancestors = getAncestors(session, doc);
log.debug("processDocumentAboutToBeRemoved: Start !");
if (doc.isVersion()) {
log.debug("processDocumentAboutToBeRemoved: doc " + doc.getId() + " is a version. NoOp !");
return;
}
long docCount = getCount(doc);
updateCountStatistics(session, doc, ancestors, -docCount);
log.debug("processDocumentAboutToBeRemoved: Stop !");
}
Hope this will help. (This is for 6.0-HF25…) Regards !
NXP-19531 fixes all this but has not been backported to 6.0 due to the patch containing extensive changes.
11/09/2016