Feature request for the addition of module hooks for insert, update, and delete of card data to allow other modules to react to these operations.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | commerce_cardonfile-add-crud-hooks-1808166-3.patch | 3.64 KB | recrit |
| #1 | commerce_cardonfile-add-crud-hooks-1808166-1.patch | 3.64 KB | recrit |
Comments
Comment #1
recrit commentedThe attached patch ...
In testing the new hooks, I ran into #1539344: Error in commerce_cardonfile_data_delete so this patch includes a fix for the delete query.
Comment #2
jpstrikesback commentedThis is pretty cool but I believe the delete invocations should be placed before the db_delete i.e. before the db is changed, so that other modules can act before it is gone (even tho you pass the original $card_data). This seems to be the pattern in core (see hook_node_delete)
Comment #3
recrit commentednice catch... re-rolled patch
Comment #4
berdirThis makes sense, although I'm wondering if we shouldn't just make it a real entity, then we'd get the standard entity CRUD hooks for free. There is an issue for that at #1777352: Expose Card Data as a Drupal Entities.
* Hook documentation from this issue would still be useful, maybe it could be merged into the other one.
Comment #5
recrit commentedI agree with the entity route, however, it's an architectural change and would cause issues with contrib modules using card on file. Entity based could be the 2.x branch.
Comment #6
dwkitchen commentedThis has been done in 2.x by moving to entities.