Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
We've now full crud-hooks for entity types, but we don't allow customizing the names of those via hook_entity_info() except for hook_entity_load(). So let's do away with that key in hook_entity_info() - if really necessary entity types can still customize it in their own storage controller.
Comment | File | Size | Author |
---|---|---|---|
#11 | entity_load_custom_remove.patch | 2.24 KB | fago |
#10 | entity_load_custom_remove.patch | 1.7 KB | fago |
#7 | 1618164-hook-load-remove-7.patch | 2.67 KB | aspilicious |
#1 | 1618164-hook-load-remove-1.patch | 2.53 KB | aspilicious |
Comments
Comment #1
aspilicious CreditAttribution: aspilicious commentedHmm thats it?
Comment #3
aspilicious CreditAttribution: aspilicious commentedApparantly not... the load hooks are not called at all anymore I think...
Comment #4
fagoexactly, we just need to update the statement to go with the fixed hook name.
Comment #5
aspilicious CreditAttribution: aspilicious commentedBut how do I get the fixed "$name" in the function?
Comment #6
fagoJust do $hook = $entity_type . '_load'; ?
Comment #7
aspilicious CreditAttribution: aspilicious commentedNot sure about this...
Comment #9
aspilicious CreditAttribution: aspilicious commentedI give up, I've no idea how to replace this functionality.
Comment #10
fagook, let me try.
Comment #11
fagooh, forgot the entity_get_info() hunk. Updated.
Comment #12
aspilicious CreditAttribution: aspilicious commentedI fail to see the difference between this and calling module_invoke. But if it's green everyones happy :D
RTBC it is
Comment #13
fagoYou missed passing on the load-arguments, so the node-controller's load arguments ($type) were missing.
Comment #14
webchickThis seems like a nice clean-up, and makes the API more consistent by not explicitly encouraging arbitrarily-named loader functions.
Committed and pushed to 8.x. Thanks!
This will need a change notice.
Comment #15
BerdirI have no idea what you could possibly write more than this: http://drupal.org/node/1642370
There's no point in before/after code examples or anything like that...
Comment #16
fagoThe change notice looks good, I agree that's all that's needed. I've just added an "entity" to its title so the title makes clear it's about entity loading.
Comment #18
fagoRemoving sprint tag.