We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • It simple... I want version control for resources, snippets, templates, and chunks.

    Just a simple ability to rollback to previously stored versions.

    -D
      • 26903
      • 1,336 Posts
      If your using Evolution have a look at Auditor http://modxcms.com/extras/package/24r, for Revolution AFAIK there is no solution at the mo.
        Use MODx, or the cat gets it!
        • 24287
        • 14 Posts
        I’m using Revo and would second this request smiley
        • Version Control is on the Revolution Roadmap but Revo community developers may in all likelihood come up with an interim solution. We know it is important but as part of the core it is important to do it right. Maybe if you could describe how you’d expect version control to work in an ideal world for you that would help others create a solution.
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub
            • 26903
            • 1,336 Posts
            Its feasible of course to implement Auditor in Revo, the existing module would just become a 3PC with viewing/recovery of data implemented on separate tabs, ExtJS would make this easier and with the database schema being in XML format we can parse this intelligently to implement the history database and its triggers.

            I’ve not really pursued this as I know versioning is on the roadmap, we don’t want to duplicate effort here, nor do | suspect we want people to get used to one way of doing this(not integrated into the core) then be asked to dump it when core versioning comes along.

            Just my 2 cents
              Use MODx, or the cat gets it!
              • 22629
              • 194 Posts
              Perhaps rather than having modx use it’s own source control or versioning (or even in addition to) how about integrating with the likes of SVN?

              Have a settings page in modx which links the site to a base SVN repository (and path within the repository) - something like:

              Protocol: file/svn/http/https
              URL: my.svn.server.com/repo [or /path/to/repo for file type]
              Port: 3960 [only used for svn/http type]
              Base path: /trunk


              modx could then create folders within the SVN repository when it’s created, and create files in the repositories for the elements. Chunks and snippets are cached anyway, so I don’t see it being a problem that they’re written to the file system first.

              /path/to/repo
               - trunk
               - - chunks
               - - - home page <-- category
               - - - - adverts.tpl <-- chunk element
               - - snippets
               - - - generic <-- category
               - - - - getResources.tpl <-- snippet element
               - - templates
               - - - home page <-- category
               - - - - home.tpl <-- template element


              You could also have an option then to revert the element back to a previous revision, which does an export from the repository, reads the text in and updates the database.

              It would be more difficult to keep the database/repository in-sync as people could go into the repository to change things, but I’m sure we could come up with some form of verification utility.
                Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

                modx Revolution 2.2.6
                Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

                Content-Managed Websites Built on MODX
                • 26903
                • 1,336 Posts
                Ok, but not everything is cached, i.e it’s not present on the file system, only in the database, so it’s invisible to SVN, also If I update a chunk say five times how do I roll it back? All I’ve done is five database updates, SVN can’t know this at all.

                This is more to the point I’m making :-
                You could also have an option..

                Where would this option be? In a 3PC? It can’t be on a core menu item without changing the core.

                Again,
                some form of verification utility...

                Which lives where? 3PC or core?

                IMHO version control needs to be integrated into the core, its on the roadmap, any other interim solution will by definition be inferior to this.

                  Use MODx, or the cat gets it!
                  • 22629
                  • 194 Posts
                  Quote from: shamblett at Nov 03, 2010, 07:16 PM

                  Ok, but not everything is cached, i.e it’s not present on the file system, only in the database, so it’s invisible to SVN, also If I update a chunk say five times how do I roll it back? All I’ve done is five database updates, SVN can’t know this at all.

                  That’s the idea - modx (or the 3PC) would take care of this. When you update your chunk/snippet/whatever it gets updated in the site’s working copy and committed to SVN.

                  Quote from: shamblett at Nov 03, 2010, 07:16 PM

                  Where would this option be? In a 3PC? It can’t be on a core menu item without changing the core.

                  Revolution certainly lets you add items to the menus. The whole architecture of Revo is that you don’t have to modify the core to add new functionality.

                  http://rtfm.modx.com/display/revolution20/Custom+Manager+Pages

                  Quote from: shamblett at Nov 03, 2010, 07:16 PM

                  Which lives where? 3PC or core?

                  Either. If the modx team want versioning as part of the core, then the core. Otherwise a 3PC. It could even be a custom manager page with the code to do the verification behind it.

                  Quote from: shamblett at Nov 03, 2010, 07:16 PM

                  IMHO version control needs to be integrated into the core, its on the roadmap, any other interim solution will by definition be inferior to this.

                  Not necessarily. I could think of other solutions which won’t be inferior but will do the job just fine, even outside of the core. For example - database triggers.

                  My point about SVN is that it’s a brilliant system. Myself and I’m sure many others are already using it for versioning templates or source code. Why can’t this be integrated into the source control we all know and love?
                    Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

                    modx Revolution 2.2.6
                    Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

                    Content-Managed Websites Built on MODX
                    • 26903
                    • 1,336 Posts
                    For example - database triggers.
                    Yes, going back to my earlier post this is what Auditor on evo uses, totally transparent to MODx except for a small management module to install and manage it.

                    What I mean by ’integrate with the core’ is to put another entry on a context menu on a resource, so you can create/edit/quick update etc. and also add roll back or whatever other versioning commands you need on a resource by resource basis. You can’t do this yet(not really anyway). A 3PC is not integrated with the core IMHO , its integrated into the manager.
                      Use MODx, or the cat gets it!
                      • 13736
                      • 345 Posts
                      From an interface stand point, I like the way it’s handled in Google Docs. They redesigned it recently and I think the layout is logical.