Closed (fixed)
Project:
farmOS
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Aug 2022 at 13:25 UTC
Updated:
9 Sep 2022 at 15:34 UTC
Jump to comment: Most recent
Logs currently dispatch events when entity operations are performed, but assets do not.
Let's add an AssetEvent that is dispatched on presave, insert, update, and delete.
Implement.
None.
None.
None.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
m.stentaThere is an upstream Drupal core issue to implement this for all entity types: #2551893: Add events for matching entity hooks
So this would be a stop-gap until that lands in core. Notably the Log module has
@todos to use the core events too: https://git.drupalcode.org/project/log/-/blob/e0751d66501c68fcc3b0e78598...Comment #4
m.stentaComment #5
m.stentaThe reason I did this was to support https://github.com/farmOS/farmOS/pull/537, specifically:
If we decide NOT to do that, then maybe we don't actually need to merge this in now. If nothing is going to make use of this event yet, then maybe it would be better to punt on it, in hopes that the core issue upstream lands.
Comment #6
farmer-ed commentedI like this one, events for assets could be useful, I'm trying to automate as much as possible synchronization of livestock assets between the the Department of Ag database and farmOS, could be useful for certain logs to be generated when a new Asset is created. Like a birth log if a new calf is added with a mother already in my herd, I can already achieve this externally but the simpler the better.
Comment #7
paul121 commentedComment #10
m.stentaThanks for the input @farmer-ed - I agree it's nice to have this. Merged!