[OPEN-ILS-DEV] Passing parameters to patron search in staff client

Mark Gavillet mark.gavillet at ptfs-europe.com
Fri Sep 23 04:05:42 EDT 2011


Hi,

I'm relatively new to Evergreen development and I'm having some problems sending a predefined search to the patron screen in the staff client. The code I'm using to pass the parameters (in a modified version of barcode_entry.xul) is:

var loc = xulG.url_prefix( horizontal_interface ? urls.XUL_PATRON_DISPLAY : urls.XUL_PATRON_DISPLAY );
window.xulG.set_tab( loc, {}, {"query":{"family_name": "smith", "first_given_name": "john", "dob": "1950-01-01", "inactive": "true", "search_depth": "0"}} );

A normal patron search submitted using the search form works fine, but passing the predefined search using the code above gives the error:

!! This software has encountered an error.  Please tell your friendly system administrator or software developer the following:\npatron/display.xul\nSyntaxError: missing ] after element list\n

Oddly, the search works perfectly if I pass it directly into the results file by changing the first line of code to:

var loc = xulG.url_prefix( horizontal_interface ? urls.XUL_PATRON_SEARCH_RESULT : urls.XUL_PATRON_SEARCH_RESULT );

Using this line I get a full set of results without any errors, so I'm assuming the search string is in the correct format.

If anyone could help me narrow this down I'd be really grateful - not only did I spend six hours struggling with the same error message yesterday, I also woke at 4am this morning to realise that I'd been dreaming about coding the same script and trying to fix it in my sleep! Not a good sign...

Many thanks,
Mark


More information about the Open-ils-dev mailing list