Problem/Motivation
This is following in the footsteps of the Log module: #3576546: Deprecate and remove log entity presave/insert/update/delete events
The farmOS Asset, Organization, and Quantity modules dispatch events for entity operations (eg: presave, insert, update, and delete).
These were copied from the Log module (first to Asset, then Quantity, then Organization). The thought at the time was that Drupal core was going to move towards using the same pattern in #2551893: Add events for matching entity hooks. Instead, Drupal core stuck with the hook system, but moved them to classes: #3483599: Convert all procedural hook implementations to Hook classes (also see this change record: https://www.drupal.org/node/3486534)
Currently the Asset/Organization/Quantity events are dispatched via standard entity hooks, and there are @todos to remove those hooks if/when #2551893: Add events for matching entity hooks was merged. Since that is never going to happen, these @todos will never be resolved.
Proposed resolution
Let's deprecate the Asset/Organization/Quantity entity events in farmOS 4.x and remove them in 5.x.
Remaining tasks
- Deprecate events in 4.x.
- Refactor code to use hooks.
- Remove in 5.x.
User interface changes
None.
API changes
The following events will be deprecated in Log 3.x and removed in 4.x:
\Drupal\asset\Event\AssetEvent::PRESAVE\Drupal\asset\Event\AssetEvent::INSERT\Drupal\asset\Event\AssetEvent::UPDATE\Drupal\asset\Event\AssetEvent::DELETE\Drupal\organization\Event\OrganizationEvent::PRESAVE\Drupal\organization\Event\OrganizationEvent::INSERT\Drupal\organization\Event\OrganizationEvent::UPDATE\Drupal\organization\Event\OrganizationEvent::DELETE\Drupal\quantity\Event\QuantityEvent::PRESAVE\Drupal\quantity\Event\QuantityEvent::DELETE
Data model changes
None.
Comments
Comment #2
m.stentaPull request: https://github.com/farmOS/farmOS/pull/1056