Turn off version control

Permalink 1 user found helpful
Hi

I would like to ask if it's possible to turn the version control of concrete 5 off.

I would like to enable if when the side it going into productive state.

Cheers

 
shadowcomputers replied on at Permalink Reply
shadowcomputers
Asked the question of turning off versioning with C5 core team in their live Totally Random show and they have said that it is not possible.

You can go and delete old version through versioning popup for the page from either edit mode or the site map, but that is the only way... currently.

They did mention that a while ago someone posted about a way you can do a tidy on old page versions, so that only the last say 5 remained, but I have not been able to find any mentions of that yet.
shadowcomputers replied on at Permalink Reply
shadowcomputers
This post might be worth a look - it is about deleting old content from your site:http://www.concrete5.org/community/forums/usage/delete-pages-after-...
zoinks replied on at Permalink Reply
I'm curious if this has changed in C5.5+

I think versions are the only thing that really slow my site down. If I delete old versions as I go, there is never really any issues. It gets pretty annoying to have to click 3 extra times to delete the previous version, though. Good way to get carpal tunnel, too. I think the speed sacrifice makes it an utterly useless feature and it should probably have the option to disable it on install.
TheRealSean replied on at Permalink Reply
TheRealSean
There is an automated job that will delete all but the 10 most recent versions of a page it can be accessed from the automated jobs page within the dashboard

/index.php/dashboard/system/optimization/jobs/
zoinks replied on at Permalink Reply
Thanks, but 10 is not low enough. If I have about 4 versions on a few pages, stuff starts to go slow. I'll just use the solution of version removal james mentioned below.
TheRealSean replied on at Permalink Reply
TheRealSean
It can be tweaked to be lower if you add the following to your site.php

define('OLD_VERSION_JOB_PAGE_NUM',2);

I know you say you are happy removing it completely, but if you would like just a little bit of backup :) you could tweak the constant then have a bookmark of the jobs automated url.
zoinks replied on at Permalink Reply
Hmmm.... Well, it's always good to have options. Thank you for sharing this idea with me. Must be nice to be able to figure this stuff out. :)

ps. I marked yours as "best answer" so you'd get some karma for your help, but then I marked james' again cuz when I revisit this page I want to be able to find that solution quickly since I really never use version control for anything at all ever.
jamespeterbaltas replied on at Permalink Best Answer Reply
I also don't like version control. You can turn it off by overriding the createNew function of collection_version.Open ROOT/models/collection_version.php and paste:

<?php 
defined('C5_EXECUTE') or die("Access Denied.");
class CollectionVersion extends Concrete5_Model_CollectionVersion {
  function createNew() {
    $db = Loader::db();
    $c = Page::getByID($this->cID, $this->cvID);
    return $c->getVersionObject();
  }
}


You can also hide version options from the menu by copying the page_controls_menu_js.php from the concrete directory to ROOT/options/page_controls_menu_js.php. Then just search for the strings and delete them.
zoinks replied on at Permalink Reply
Thank you so much! Marked as best answer.
fastcrash replied on at Permalink Reply
fastcrash
hii james, it's really nice code you have there
i waiting this for a long long time


i see it on 5.5 version, how about 5.4? it is work? (i hope so, please :)

i see the collevtion_version.php in 5.5, the code far different in 5.4

only 2 line code, omg! i cant trace it, it's my first time seeing 5.5 code
class CollectionVersion extends Concrete5_Model_CollectionVersion {}


that job version sean mention is in 5.5 too