I want to create some custom logs, but I have found a way to do so by adding new taxonomy terms. I want to link these to the log type ‘activity’ so that the different taxonomies I have added for example: vaccination/feeding time. All which are examples of different logs I want workers to log against an asset, an asset here being an animal. I do not have an option to manage fields on the log activity type. Can anyone guide me on how I can customise my logs via the UI.
Hi @888m - could you use the existing “Log Category” taxonomy and just add terms to that? Then you can reference those categories from your activity logs.
I do not have an option to manage fields on the log activity type. Can anyone guide me on how I can customise my logs via the UI.
If you want to add custom fields to your log types, Drupal provides a UI for doing that via the field_ui
module.
It’s extremelly powerful and allows for a lot of customization possibilities, but I would caution against the potential risks as well: if you add a custom field with a certain name, and then farmOS core decides to add a field with the same name in the future, it will conflict and you won’t be able to upgrade in the future. So always namespace your fields in a way that prevents potential conflicts.
Also a good idea to test and maintain customizations like this in a module that is managed via Git source control, so you can test it in a development copy of your site and have very intentional deployments to your “live” site after you know it won’t cause issues. Diving into code and data model customization carries risk of database corruption. ALWAYS TEST AND TAKE BACKUPS!
Thanks, farm_UI is a powerful tool, all my research was leading me astray but this made it easier to achieve what I wanted, thanks.
Hey @mstenta Not sure you can help again, I have added more logs under the admin/config/development/configuration/single/import. They show when I am on my homescreen and as log types. But each time I click’manage fields’ my site times out. Any resolve would be great, thanks !
Adding log types require adding a PHP file to a module. They cannot be created through the UI alone. You found a way around that using the config importer, but that only creates the configuration for the log type, not the PHP class.
Documentation: Entity types | farmOS