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

ANSWER



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 !

0 votes



NXP-19531 fixes all this but has not been backported to 6.0 due to the patch containing extensive changes.
11/09/2016


I have reproduced your issue. Please follow this ticket to see its resolution.

Thanks.

0 votes



Hi,

AFAIK, most of Quota bugs were recently fixed in the latest hotfixes. So you should update your platform and test if the problems are still there.

Regards.

0 votes



Thank you for your answer. I just tried Nuxeo 6.0-HF16 with nuxeo-quota-1.40 and the "bug" is still here.

Do you think I can use nuxe-quota-1.5.2 with Nuxeo 6.0-HF16 ?

Regards.

07/29/2015

I just tried Nuxeo 6.0-HF16 with nuxeo-quota-1.5.2 and the bug is still here.
07/29/2015