diff --git a/model/Versioned.php b/model/Versioned.php index 759338430..b2e2de3a0 100644 --- a/model/Versioned.php +++ b/model/Versioned.php @@ -79,6 +79,14 @@ class Versioned extends DataExtension { 'Version' => 'Int' ); + /** + * Used to enable or disable the prepopulation of the version number cache. + * Defaults to true. + * + * @var boolean + */ + private static $prepopulate_versionnumber_cache = true; + /** * Keep track of the archive tables that have been created. * @@ -1095,6 +1103,9 @@ class Versioned extends DataExtension { * @param array $idList */ public static function prepopulate_versionnumber_cache($class, $stage, $idList = null) { + if (!Config::inst()->get('Versioned', 'prepopulate_versionnumber_cache')) { + return; + } $filter = ""; if($idList) {