Issue
- Setting the limit of file versions to file following the article, however there are still more than 5 versions are available in Documents and Media :
- https://help.liferay.com/hc/en-us/articles/8309859165325-I-want-to-limit-content-versions-in-documents-and-media - (It is confirmed that updating existing files, removes prior versions.)
Environment
- DXP 7.0+
Resolution
- Version A:
- It can be resolved with the utilization of Groovy Script
- A way to create such a script would probably be to adapt the one, Liferay made for removing old web content versions:
Example: Removing Intermediate Journal Article Versions.
- The script sorts all articles by version in ascending order and also allows a certain number to be kept.
- Version B:
- Following the article shared on the Liferay Developer Community page: How to clean previous version of documents from Document and Media
- Be advised, however, this script removes all other versions other than the latest one
Subscriber Exclusive Content
A Liferay Enterprise Subscription provides access to over 1,500 articles that include best practices, troubleshooting, and other valuable solutions. Sign in for full access.
Sign In