Most core models have before/after delete/save events, but there are no events for when the model is fetching data. My use case was modifying the categories displayed on the Publish page when viewing a draft or translated entry. I was able to work around it (pretty smoothly actually) by using the custom_field_modify_data hook. Wondering if its viable to add event hooks like after_category_read/fetch/get?
I know we have some pretty significant concerns about performance and application stability with attaching events to read queries, but thanks for sharing the use case. We’ll chat and see what the best way is to accommodate this type of thing, which does seem useful for the publish page.
We’re thinking we’re going to hold off on these read hooks for now. As Derek said, we’re a little worried about performance and other unintended side effects. We try to be fairly cautious and deliberate about adding hooks. If a particular hook is the only way to solve a legit problem, we usually add them, but since these don’t seem to be needed just yet, think we’ll hold off for now and see what can be done with existing extensibility. But thanks for bringing it up!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.