Enable logging on a large number of fields


I was wondering if anyone had ever gone about setting a large number of fields (all fields in a module for instance) to be audited programmatically before, doing it through studio seems like it would be a large time waster.

Thanks in advance.

You could do this by creating a vardef extension and setting the fields to be audited that way.

I.e. adding the following to custom/Extension/modules/TheModule/Ext/vardefs/AuditChanges.php:

$dictionary['TheModule']['fields']['the_field'] ['audited'] = 1;
$dictionary['TheModule']['fields']['other_field'] ['audited'] = 1;
$dictionary['TheModule']['fields']['another_field'] ['audited'] = 1;

Hope this helps,