Jump to content
eydun

Track changes to templates and fields

Recommended Posts

@teppos changelog-module is a great solution for tracking changes to pages.

Is there any equivalent module for tracking changes to templates and fields?

 

Share this post


Link to post
Share on other sites

This was my approach ages ago, but I'm not using it anywhere any more, because I'm using RockMigrations for all my sites 🙂 

  • Like 1

Share this post


Link to post
Share on other sites

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 😀

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites
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 😉

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

 

Share this post


Link to post
Share on other sites

Just create a module and a script that saves all this information to a file:

GHHieSn.png

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()

  • Thanks 1

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...