Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
in receipt module line 1254 I discovered this action on delete request.
function ec_receipt_action_delete($receipt, $context) {
return;
}
please insert the missing function.
Comment | File | Size | Author |
---|---|---|---|
#6 | 645344.patch | 391 bytes | burningdog |
#4 | 645344.patch | 386 bytes | burningdog |
Comments
Comment #1
Soren Jones CreditAttribution: Soren Jones commentedThis is part of a some code that was added to ec_receipt.module on March 19, 2009:
Diff of /contributions/modules/ecommerce/ec_receipt/ec_receipt.module
The added functions all seem to relate to admin/store/receipts [the ec_receipt_list view in ec_receipt.views_default.inc].
There are three bulk operations that were added to admin/store/receipts at this time: ec_receipt_action_delete, ec_receipt_action_allocate, and ec_receipt_action_refund.
ec_receipt_action_delete and ec_receipt_action_refund both seem to be dead ends.
Question:
Is admin/store/receipts [the ec_receipt_list view] a todo, an abandoned idea, or something else?
For reference:
ec_receipt_action_allocate calls ec_receipt_allocate, which is also called in ec_receipt_checkout_post_submit [in ec_receipt.checkout.inc].
Allocations can be reversed elsewhere at admin/store/receipts_alloc. "Reverse Allocation" on this page uses ec_receipt_reverse_allocation.
Comment #2
Soren Jones CreditAttribution: Soren Jones commentedComment #3
burningdog CreditAttribution: burningdog commentedIs this as simple as
DELETE FROM {ec_receipt} WHERE erid = %receipt_id
? Are there other tables we need to take into account? (Not that I can see, at least)Comment #4
burningdog CreditAttribution: burningdog commentedTo answer the question from #1, admin/store/receipts shows a view of receipts. I don't know what ec_receipt_action_refund() is supposed to do. Well, it's supposed to refund receipts - is this returning money to users at some point?
I've implemented my suggestion from #3 to allow the deleting of receipts; patch attached.
Comment #6
burningdog CreditAttribution: burningdog commentedFine then :p
Comment #7
Soren Jones CreditAttribution: Soren Jones commentedComment #9
gordon CreditAttribution: gordon commentedThis will not really work.
Just deleting the receipt is not going to leave artifacts such as allocation. We need to make sure that when delete a receipt we are able to. ie. The receipt is still allocated to a transaction, it needs to be unallocated and refunded before it can be deleted.
Allowing someone delete a receipt will cause the system to go out of balance.
I think this is why I didn't implement it and left this as it was.