it's possible to merge the precat dummy bib

Bug #792595 reported by James Fournie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

it's possible to merge the precat dummy bib into another bib, causing serious mayhem.

1. Item Status Screen, retrieve a precat
2. Actions for Cataloguers -> Add to Record Bucket
3. Retrieve the bucket using the record bucket UI
NOTE: The precat does not appear in the UI but is in fact a record in the container.biblio_record_entry_bucket_item table
4. Click "Merge All Records", you will get a strange but not informatative dialog and eventually you will be allowed to merge the records

Postgres: 8.4
OpenSRF: 1.6.3
EG: 2.0.5
Ubuntu Lucid 64bit Server

Tags: pullrequest
Revision history for this message
James Fournie (jfournie) wrote :
Changed in evergreen:
importance: Undecided → Medium
Revision history for this message
James Fournie (jfournie) wrote :

I am wondering which of the following (or combination thereof) would be the best solution:

- db constraint on container.biblio_record_entry_bucket so that record != -1
- constraint on plpsql merge function to prevent merging -1 record
- javascript message to prevent adding precats to bib record buckets
- allow precats to be shown in record buckets in the event they get in there

etc.

Revision history for this message
James Fournie (jfournie) wrote :

Also we have run this to prevent the problem, it produces a strange db error, but it's far better than having all your precats merged into a record:

ALTER TABLE container.biblio_record_entry_bucket_item ADD CONSTRAINT check_precat CHECK (target_biblio_record_entry > 0);

Revision history for this message
Shae (shae-esilibrary) wrote :

Adding to this bug, if the pre-cat bib is merged into a real bib record, every pre-cat item after this ends up on the real bib. I replicated this on a 2.1 system although it was originally reported by a customer running 2.0.7:

1. Pull up a real bib and add it to a record bucket. We'll say we pulled up The Help bib record.
2. Do a pre-cataloged checkout adding some brief title and author info. Let's say you add Morgan's Zoo as the title.
3. Retrieve the pre-cataloged bib by going to the patron's account and clicking "Show Item Details" over the item that is checked out.
4. Go to Actions for Catalogers and add this record to a record bucket, the same one as above.
5. Retrieve the record bucket.
6. Click Merge All Records and merge the pre-cataloged bib (which shows with a Record ID of -1 and no MARC record) into the real bib for The Help.
7. Retrieve The Help in the catalog. You'll now see the pre-cataloged item you just checked out attached to this bib.
8. Check the item in and you'll see it remains on this bib record just like a fully cataloged item.
9. Try another pre-cat and enter title info, such as Harry Potter. It will show properly when you first check out to the patron.
10. Refresh the patron screen and you'll now see that Harry Potter is not checked out to them, The Help is.
11. Retrieving The Help again will show you the barcode you just checked out.

Not sure how to uncouple these two bibs now. If I find out, I'll update this bug but, for now, I wanted you to know it's creating another problem other than the strange db error from before.

Revision history for this message
Jason Etheridge (phasefx) wrote :

My preference is to have the Item Status -> Add to Record Bucket action filter out pre-cats and warn that it is doing so. To that end, here's a branch doing such:
http://git.evergreen-ils.org/?p=working/Evergreen.git;a=commitdiff;h=bf4cb5ae666e29489053dfa817be3979d545004d

For sharing the current branch via the remote repo working-eg:

You need only add the remote once, regardless of how many branches you wish to look at.
To add this repo as working-eg:
 Read-only (git protocol):
  git remote add working-eg git://git.evergreen-ils.org/working/Evergreen.git
 Read-write (ssh protocol):
  git remote add working-eg <email address hidden>:working/Evergreen.git

Once you have the remote added you can check out this branch:
git co -b precat_bib_sneaking_into_buckets_fix working-eg/collab/phasefx/precat_bib_sneaking_into_buckets_fix

tags: added: pullrequest
Revision history for this message
Mike Rylander (mrylander) wrote :

I will leave this bug open after applying Jason's branch, because I'm not a fan of a db change for 2.0 or 2.1 at this point. If we decided to add DB protection in master, let's do that later.

Revision history for this message
Mike Rylander (mrylander) wrote :

Pushed into master through 2.0.

Changed in evergreen:
status: New → In Progress
Revision history for this message
Mike Rylander (mrylander) wrote :

Closing this one, as the pullrequest is pushing it to the top of my list. See bug 827356 for the part that remains (db protection).

Changed in evergreen:
status: In Progress → Fix Committed
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.