44 votes

UnVersion

SUMMARY

This package automaticaly removes any previous versions for those times when a version history aren't important, and you don't want to take up the database space.

With Umbraco being such a versatile platform, it's very easy to develop small scale apps that go beyond the regular "Content" paradim. In some situations, version history becomes unimportant, and a waste, so this package automaticaly cleans up any previous versions when a new version is published.

HOW TO USE

The package is configured via an unVersion.config file located in the default umbraco config folder.

To define a new unversion rule, create an add element with the following attributes.

docTypeAlias [Optional] - The doc type alias of the documents to be unversioned, if undefined, applies to all (If you don't define docTypeAlias, it is advised you define rootXpath to narrow down the scope of the unversion).

rootXpath [Optional] - An xpath statment to define the root folder for the unversion rule, ie: //NewsIndex

maxDays [Optional] - The maximum number of days to keep versions. If attribute is not present, defaults to int.MaxValue (Pre v2.0 defaults to 0, so bare this in mind).

maxCount [Optional] - The maximum number of latest versions to keep. If attribute is not present, defaults to int.MaxValue (Pre v2.0 defaults to 0, so bare this in mind).

UPDATE

1.2.0 - Umbraco 4.5 compatable

1.2.1 - Added maxDays attribute

1.2.2 - Added maxCount attriute

1.3 - Umbraco 4.6 (SQL CE 4) compatable

1.4 - Fixed date comparison issue

1.5 - Event handler now checks for HttpContext before commencing

2.0 - Rewritten for Version 7. With this update, maxDays and maxCount are now dependant on each other, so a version must fall within both boundaries to be kept. In previous versions of the package, a node was kept if it was within either one. Because of this update, both properties now default to int.MaxValue if no attribute is defined.

2.1 - Merged in pull request #1 to stop errors on larger sites due to db connection being left undisposed.

BUGS & ISSUES

Please raise any issues on the forum below. All feedback is welcome and appreciated.

Project owner

Matt Brailsford

Matt Brailsford

Matt has 9299 karma points

Project Compatibility

This project is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
7.12.x (untested)
7.11.x (untested)
7.10.x (untested)
7.9.x (untested)
7.8.x (untested)
7.7.x (untested)
7.6.x (untested)
7.5.x (100%)
7.4.x (untested)
7.3.x (untested)
7.2.x (100%)
7.1.x (100%)
7.0.x (untested)
6.1.x (untested)
6.0.x (untested)

You must login before you can report on package compatibility.

Project Information

  • Project owner: Matt Brailsford
  • Created: 14/06/2010
  • Current version 2.1
  • License MIT
  • Downloads: 5381