Just a patch to add the hook to the API.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nvahalik’s picture

Status: Active » Needs review
joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Needs a new line at the bottom but that can be fixed on commit. Thanks @nvahalik

joelpittet’s picture

Category: Feature request » Task

This isn't a feature it's really a doc task.

rszrama’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +sprint

I personally might favor a single doc block in a commerce.api.php file for hook_ENTITY_TYPE_delete(). May as well cover all the bases with one function per relevant CRUD operation instead of adding them to the individual files. Thoughts?

joelpittet’s picture

This one seems a bit more helpful as an example API usage but if you want to make it generic and all the commerce entities have _delete, maybe that's works better for you.

nvahalik’s picture

IMO, entity-specific hooks are important because they can provide useful context and that is always a good thing to have. Another reason it is nice to for discoverability. Having *_ENTITY_*() hooks are wonderful, but unless you are looking very specifically for them, they can be a bit harder to find and use than if they are explicitly defined.

joelpittet’s picture

+1 to #6 that's what I meant but written better:)

mglaman’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
724 bytes

My patch just fixes newline warning. +1 to individual entity hooks because PhpStorm and other IDEs provide hook completion. It also provides a way to "jump" to the doc in api.php for better explaination. Can't get that from a generic placement. Also, you'd then be overriding it for everyone with hook_ENTITY_TYPE_delete

mglaman’s picture

Adjusting credit & committing info: EDIT.. apparently can't save the authorship!

mglaman’s picture

Status: Reviewed & tested by the community » Fixed

  • mglaman committed ea4f3d4 on 7.x-1.x
    Issue #2511484 by nvahalik, mglaman: Add hook_commerce_order_delete() to...

Status: Fixed » Closed (fixed)

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