Bug 38325 - Cannot delete invoice while viewing it
Summary: Cannot delete invoice while viewing it
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Phil Ringnalda
QA Contact: Lucas Gass (lukeg)
URL:
Keywords: rel_24_05_candidate
Depends on:
Blocks: 36192
  Show dependency treegraph
 
Reported: 2024-11-01 15:49 UTC by Phil Ringnalda
Modified: 2024-11-07 16:34 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 38325: Cannot delete invoice while viewing it (2.77 KB, patch)
2024-11-01 16:44 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 38325: Cannot delete invoice while viewing it (2.81 KB, patch)
2024-11-01 17:57 UTC, David Nind
Details | Diff | Splinter Review
Bug 38325: Cannot delete invoice while viewing it (2.87 KB, patch)
2024-11-05 20:52 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Ringnalda 2024-11-01 15:49:35 UTC
In the list of invoices in invoices.pl, an invoice that can be deleted (because nothing has ever been received into it) has a Delete action that uses submit-form-link and works with CSRF protection.

In invoice.pl where you are viewing an individual invoice, the Delete link still thinks that invoice.pl?op=delete will work, which it won't.
Comment 1 Phil Ringnalda 2024-11-01 16:44:36 UTC
Created attachment 173877 [details] [review]
Bug 38325: Cannot delete invoice while viewing it

The link to delete while viewing an individual invoice needs to be updated to
use submit-form-link so it can POST with op='cud-delete'.

Test plan:
 1. Home - Acquisitions, click Search with an empty Vendor: input
 2. Click Receive shipments, enter a number in the Vendor invoice input,
    click Next
 3. In the left sidebar, click Invoices, click Search without any parameters
 4. In the row for your invoice, click the invoice number link
 5. Next to the Save button, click the Delete link, click OK in the
    confirmation alert
 6. You'll see the page reload, and the URL change to include ?op=delete,
    but your invoice remains undeleted.
 7. Apply patch, reload the page
 8. Click Delete, click OK in the confirmation alert
 9. Click Search with no parameters, just to make sure the message about
    "Sorry, but there are no results for your search" really truly means
    that your invoice was deleted and now you don't have any invoices

Sponsored-by: Chetco Community Public Library
Comment 2 David Nind 2024-11-01 17:57:43 UTC
Created attachment 173886 [details] [review]
Bug 38325: Cannot delete invoice while viewing it

The link to delete while viewing an individual invoice needs to be updated to
use submit-form-link so it can POST with op='cud-delete'.

Test plan:
 1. Home - Acquisitions, click Search with an empty Vendor: input
 2. Click Receive shipments, enter a number in the Vendor invoice input,
    click Next
 3. In the left sidebar, click Invoices, click Search without any parameters
 4. In the row for your invoice, click the invoice number link
 5. Next to the Save button, click the Delete link, click OK in the
    confirmation alert
 6. You'll see the page reload, and the URL change to include ?op=delete,
    but your invoice remains undeleted.
 7. Apply patch, reload the page
 8. Click Delete, click OK in the confirmation alert
 9. Click Search with no parameters, just to make sure the message about
    "Sorry, but there are no results for your search" really truly means
    that your invoice was deleted and now you don't have any invoices

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Lucas Gass (lukeg) 2024-11-05 20:52:05 UTC
Created attachment 174045 [details] [review]
Bug 38325: Cannot delete invoice while viewing it

The link to delete while viewing an individual invoice needs to be updated to
use submit-form-link so it can POST with op='cud-delete'.

Test plan:
 1. Home - Acquisitions, click Search with an empty Vendor: input
 2. Click Receive shipments, enter a number in the Vendor invoice input,
    click Next
 3. In the left sidebar, click Invoices, click Search without any parameters
 4. In the row for your invoice, click the invoice number link
 5. Next to the Save button, click the Delete link, click OK in the
    confirmation alert
 6. You'll see the page reload, and the URL change to include ?op=delete,
    but your invoice remains undeleted.
 7. Apply patch, reload the page
 8. Click Delete, click OK in the confirmation alert
 9. Click Search with no parameters, just to make sure the message about
    "Sorry, but there are no results for your search" really truly means
    that your invoice was deleted and now you don't have any invoices

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Katrin Fischer 2024-11-07 16:34:00 UTC
Pushed for 24.11!

Well done everyone, thank you!