eydun Posted April 27, 2020 Share Posted April 27, 2020 @teppos changelog-module is a great solution for tracking changes to pages. Is there any equivalent module for tracking changes to templates and fields? Link to comment Share on other sites More sharing options...
bernhard Posted April 27, 2020 Share Posted April 27, 2020 This was my approach ages ago, but I'm not using it anywhere any more, because I'm using RockMigrations for all my sites ? 1 Link to comment Share on other sites More sharing options...
eydun Posted April 28, 2020 Author Share Posted April 28, 2020 Thank you for the info. Your RockMigrations module looks good. Would be cool, if it also had a changelog to local changes made to templates and fields ? Link to comment Share on other sites More sharing options...
bernhard Posted April 28, 2020 Share Posted April 28, 2020 Making automatic migrations is not possible. That's because migrations need to know the order of several actions (first this, then that, then that). For example you can only assign a field to a template once the template exists. Link to comment Share on other sites More sharing options...
eydun Posted April 30, 2020 Author Share Posted April 30, 2020 Making automatic migrations is not possible. I imagine that some kind of combined solution between automatic and manual would be optimal. That is, if there is a local changelog, then the user can select an entry in the changelog to create an migration-file for that change (e.g. new field that has been created). I saw that there was a code-generator component in Nette ? Link to comment Share on other sites More sharing options...
bernhard Posted April 30, 2020 Share Posted April 30, 2020 You could easily use the export data methods available for processwire fields and templates and store that export in a folder. Having this folder under control of GIT you'd get a changelog of your system. Link to comment Share on other sites More sharing options...
eydun Posted April 30, 2020 Author Share Posted April 30, 2020 That is a good idea ? You could easily use the export data methods Do I have to do that manually, or can it be done from cli? Link to comment Share on other sites More sharing options...
bernhard Posted April 30, 2020 Share Posted April 30, 2020 Just create a module and a script that saves all this information to a file: This data could easily be saved as JSON. Maybe there are already methods that do this (I think so, because using the GUI a JSON is written into a textarea. Just look there how it is created). Of course you don't want to run this on every page request. I don't know what the best hook would be. A simple solution would be to run on every Modules::refresh() 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now