It is possible to delete acq.cancel_reasons that are used by the system

Bug #1513554 reported by Chris Sharp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
2.8
Fix Released
Undecided
Unassigned
2.9
Fix Released
Undecided
Unassigned

Bug Description

The DB seed data adds specific acq cancel reasons that are referred to by the Evergreen application layer by ID. Currently, it is possible for a well-meaning end user to delete these statuses, causing breakage whenever certain acq functions are called. These should be protected.

Branch on the way.

Evergreen 2.7 through current master
OpenSRF 2.4.1
PostgreSQL 9.3
Ubuntu 14.04

Revision history for this message
Chris Sharp (chrissharp123) wrote :

Working branch here: http://git.evergreen-ils.org/?p=working/Evergreen.git;a=commit;h=ba7d238f4b111fe5a2bdab8d8d1f704c4bde5c27

To do: add a pgtap test.

NOTE: this branch creates a new function in the evergreen schema that can be re-used for similar purposes.

Many thanks to Bill Erickson and Galen Charlton for assistance on this.

Revision history for this message
Chris Sharp (chrissharp123) wrote :

Okay pgtap test added (my first!). Rebased branch is ready for further testing and signoff.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=commit;h=e2a889bf5861f46f7fb32eb141892360869cc136

tags: added: pullrequest
Revision history for this message
Chris Sharp (chrissharp123) wrote :

Actually... I realized this morning that my test should be in the "t" directory, not "live_t", so here is my newly rebased, force-pushed branch:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=commit;h=8c7ab3e13e3e5744d95c6ed645d3cc25527e9fee

Kathy Lussier (klussier)
Changed in evergreen:
assignee: Chris Sharp (chrissharp123) → Kathy Lussier (klussier)
Revision history for this message
Kathy Lussier (klussier) wrote :

Works for me. I was unable to select any stock cancel reasons in the interface, trying to delete them via the database threw the expected error message, and the pgtap test ran successfully.

I added a commit with some documentation because I was concerned people might not understand why they couldn't select a checkbox in the interface. If you have no custom cancel reasons, it's difficult to tell that they're grayed out.

Signoff branch with the additional doc commit is available at:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/kmlussier/lp1513554_do_not_delete_reserved_cancel_reasons

Changed in evergreen:
assignee: Kathy Lussier (klussier) → nobody
milestone: none → 2.next
tags: added: signedoff
Revision history for this message
Jason Stephenson (jstephenson) wrote :

It works for me, too!

Signed off and pushed to master, rel_2_9, and rel_2_8.

Thanks Chris and Kathy.

Changed in evergreen:
status: New → Fix Committed
Changed in evergreen:
milestone: 2.next → 2.10-beta
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.