[OPEN-ILS-DEV] Vandelay Item Import - Patch

Dan Wells dbw2 at calvin.edu
Wed Jan 20 18:12:26 EST 2010


Hello,

I have been doing a lot of experimenting with Vandelay the last few weeks and have traced many of my failures to one distinct bug.  I finally noticed yesterday why Item Import worked for the 'admin' user but for nobody else.  It turns out there is a bug in one of the database functions where it treats the queue 'owner' column as an org_unit ID when in fact it is a usr id.  Of course since 'admin' is ID 1 out of the box and there is an org_unit 1 as well, this bug is transparent to admin and easy to miss.

Well, I started by making a few changes to the function to address this, but soon realized that what we really wanted to do was base the import on the Import Def chosen by the user when the records are loaded, and it would be ideal if the Import Def was somehow associated with the queue at the time of import.  I started poking around in the schema, and lo and behold, the vandelay.bib_queue table already had an 'item_attr_def' linking column for this very purpose which was going unused!

So, the attached patch finally puts this column to use by doing the following:

1) Edits the create_bib_queue() sub in Vandelay.pm to accept the item import attribute definition ID as an argument and save it appropriately.

2) Edits the vandelay.js interface file to accept and send the import definition ID to create_bib_queue() when creating a queue.

3) Edits fm_IDL.xml to add the 'item_attr_def' field (and fix a small labeling error).

4) Edits 012.schema.vandelay.sql to replace the buggy function that started all this with a now simpler, working version.  The change is actually smaller than it looks due removing one nested loop and the resulting indentation change.

Questions and comments welcome!

Thanks,
Dan
-- 

*********************************************************************************
Daniel Wells, Library Programmer Analyst dbw2 at calvin.edu
Hekman Library at Calvin College
616.526.7133


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Vandelay.diff
Type: application/octet-stream
Size: 7462 bytes
Desc: not available
Url : http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20100120/c8e4fe58/attachment-0001.obj 


More information about the Open-ils-dev mailing list