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

Bug #1513554 reported by Chris Sharp on 2015-11-05
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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

Chris Sharp (chrissharp123) wrote :

Working branch here:;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.

Chris Sharp (chrissharp123) wrote :

Okay pgtap test added (my first!). Rebased branch is ready for further testing and signoff.;a=commit;h=e2a889bf5861f46f7fb32eb141892360869cc136

tags: added: pullrequest
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:;a=commit;h=8c7ab3e13e3e5744d95c6ed645d3cc25527e9fee

Kathy Lussier (klussier) on 2015-11-07
Changed in evergreen:
assignee: Chris Sharp (chrissharp123) → Kathy Lussier (klussier)
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:;a=shortlog;h=refs/heads/user/kmlussier/lp1513554_do_not_delete_reserved_cancel_reasons

Changed in evergreen:
assignee: Kathy Lussier (klussier) → nobody
milestone: none →
tags: added: signedoff
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.10-beta
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers