We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26903
    • 1,336 Posts
    Hi,

    Being a bit of an audit trail/version control freak I’ve been experimenting with how to add this to Modx with the minimum of disruption.
    To this end I’ve written a series of sql scripts to perform this using the trigger functionality of the MYSQL database(5.0.2 and above) system.

    Basically it allows you to see what has changed between versions of content, snippets, chunks plugins etc. Not just who changed something at a certain time. Also because the updates are historied a simple roll-back scheme is available.

    This is still work in progress although I have it up and running OK on one of my test systems.

    Rather than fill this forum with intricate detail I’ve set up a projects page on my website that contains full details and the scripts etc.

    If this is of interest to anyone I’ll gladly refine it and maybe think about putting a front end on it eventually and making it a resource/plugin whatever.

    Please go http://bitez.hobby-site.com/index.php?id=82 here for details.

    Or just navigate to the software section of my site and look for the modx_audit project.

    http://bitez.hobby-site.com
      Use MODx, or the cat gets it!
      • 34017
      • 898 Posts
      Wow, this is really interesting.

      Going to look at the site now...
        Chuck the Trukk
        ProWebscape.com :: Nashville-WebDesign.com
        - - - - - - - -
        What are TV's? Here's some info below.
        http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
        http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
        • 27708 MODX Staff
        • 2,502 Posts
        Very cool. I’d love to see if this could be made into a plugin/module as this is something I know that many people are looking for in MODx.

        Thanks for the work.

        Jay
          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. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
          • 22770
          • 285 Posts
          This would be one of the most awesome plugins or modules so far. Good luck with it!
            • 20289
            • 958 Posts
            Great to see someone is working on such a nice addition, would be great to see its desired showcase on front-end too, I liked the smooth structure of it, keep up a good work smiley
              [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
              [td][Wiki] [Persian support forum]
              [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
              [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
              • 27708 MODX Staff
              • 2,502 Posts
              I’m just thinking out loud here but if this worked well this could open MODx up for use as a Wiki tool as well. Let me know if you need any help on this.

              Cheers,

              Jay
                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. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                • 26903
                • 1,336 Posts
                Yes I’ve not thought of other uses for this technique but there probably are more than just auditing.

                I’ve done some more testing on my other dev system(linux) and I’m happy we can move this forward now. I’ll need to tweak the history DB a bit
                with possibly some extra version columns and get the timestamp column sorted out but in general this works OK.

                OK, the first thing to do I think is to put together a module so users can set this up in a more sane way than hacking sql scripts.

                I’ll put together a module that has the same look and feel as the initial DB install scripts so users can enter DB name, table prefix etc and any other bells and whistles I need here with appropriate checks etc. This should get users up and running with this.

                As far as querying the data is concerned I doubt we will be able to create a module/plugin that fulfills everyones needs here but we may be able to write a general one with basic time lining etc. and supplement this with extra more specific modules/plugins for auditing document content, users, snippets, chunks etc. This allows people to mix and match and also allows them to write their own if needed.

                I’ll post progress here and code etc. on my site projects page.

                NOTE for the core dev team - I dont know how this sits with 0.9.7, this is aimed squarely at 0.9.6 users for now, I guess not everyone will immediately jump ship here when 0.9.7 comes out but we can address this/port it later if needed.

                  Use MODx, or the cat gets it!
                  • 25663 MODX Staff
                  • 12,272 Posts
                  096x will be around for a long time, at least that’s what I expect. Really excited to see someone picking up the effort in this area for the current release. Thanks! laugh
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 9941
                    • 65 Posts
                    Thanks for this.... great contribution.

                    I plan to have my ModX team create a plugin triggered by events for each manager form, first docForm, then chunkForm and snipForm, which will display the history entries as a dated list with a open/close div to show the actual content for comparison and finally a link to do a quick dom scripting copy/paste of the contents into the textarea.

                    For pages we’ll add a new tab, called History and show the list there. There will be some UI work to discover the best way to present this.... but it sounds very doable.

                    Anyone else thought about drafts? I’ve always wanted to be able to create a draft of a document that is not published but still have the last version of the document published. I think there should be a new button next to SAVE that says, SAVE DRAFT - and will just add a new entry into History without changing the current published page....

                    anyways, lots to think about and get code created for.... thanks again, I’ll post my results when they come in.



                      • 25663 MODX Staff
                      • 12,272 Posts
                      This is shaping up to be very cool. Can’t wait to see some implementation happening. smiley
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me