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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aspilicious’s picture

Status: Active » Needs review
FileSize
2.53 KB

Hmm thats it?

Status: Needs review » Needs work

The last submitted patch, 1618164-hook-load-remove-1.patch, failed testing.

aspilicious’s picture

Apparantly not... the load hooks are not called at all anymore I think...

fago’s picture

exactly, we just need to update the statement to go with the fixed hook name.

aspilicious’s picture

But how do I get the fixed "$name" in the function?

fago’s picture

Just do $hook = $entity_type . '_load'; ?

aspilicious’s picture

Status: Needs work » Needs review
FileSize
2.67 KB

Not sure about this...

Status: Needs review » Needs work

The last submitted patch, 1618164-hook-load-remove-7.patch, failed testing.

aspilicious’s picture

I give up, I've no idea how to replace this functionality.

fago’s picture

Status: Needs work » Needs review
FileSize
1.7 KB

ok, let me try.

fago’s picture

oh, forgot the entity_get_info() hunk. Updated.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

I fail to see the difference between this and calling module_invoke. But if it's green everyones happy :D
RTBC it is

fago’s picture

You missed passing on the load-arguments, so the node-controller's load arguments ($type) were missing.

webchick’s picture

Title: Remove the possibility to define custom 'load hooks' » Needs change notice: Remove the possibility to define custom 'load hooks'
Priority: Normal » Critical
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record

This 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.

Berdir’s picture

Status: Active » Needs review

I 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...

fago’s picture

Title: Needs change notice: Remove the possibility to define custom 'load hooks' » Remove the possibility to define custom 'load hooks'
Status: Needs review » Fixed
Issue tags: -Needs change record

The 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

fago’s picture

Issue tags: -sprint

Removing sprint tag.