cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting a version decrease quota list count

zyx974_
Confirmed Champ
Confirmed Champ

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.

6 REPLIES 6

Manon_Lumeau
Star Contributor
Star Contributor

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.

Thank you for your answer.

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

Manon_Lumeau
Star Contributor
Star Contributor

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

Thanks.

zyx974_
Confirmed Champ
Confirmed Champ

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 !

Florent_Guillau
World-Class Innovator
World-Class Innovator

[NXP-19531](https

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.