TPAC: In copy table, link library name to an external URL (if OU setting exists)

Bug #1201982 reported by Dan Scott
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

* Evergreen master

Per http://masslnc.cwmars.org/node/2786 add the ability to link to a library web page from the copy details section of the record display in TPAC if an org unit setting for that library exists.

An initial effort, complete with release notes entry, is available from http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dbs/linked_libraries - however, it is not yet ready for prime time. In particular, there is a bug when using the staff client with "Show More Details" that causes a crash in search results.

Many thanks to MassLNC for funding this development effort!

Revision history for this message
Dan Scott (denials) wrote :

Okay, found the problem; the copy.circ_lib attribute was not being set in misc_utils.tt2 if ou_hiding was enabled. I modified the clause to account for the staff client context and tried various combinations of staff client / OU hiding options, and all seems to be working for me.

Rebased to current master and pushed to http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/d

Revision history for this message
Dan Scott (denials) wrote :
Changed in evergreen:
milestone: none → 2.5.0-alpha1
tags: added: pullrequest
Revision history for this message
Dan Scott (denials) wrote :

Even better, actually; just define circ_lib_id all the time, and restrict the UNLESS ou_hiding_disabled clause to just the decision whether to skip through to the next iteration of the loop or not. This simplifies the logic at some infinitesimal processing cost. Branch has been updated accordingly.

Revision history for this message
Kathy Lussier (klussier) wrote :
Download full text (3.3 KiB)

Hi Dan,

Jason loaded the new code, but I'm still getting the crash when I click "Show More Details" on the search results page in the staff client. It works fine in the public catalog.

I see the following in the logs (let me know if I didn't copy all the relevant parts):

[2013-07-17 15:53:35] /usr/sbin/apache2 [INFO:20311:CStoreEditor.pm:114:137408273620311127] editor[0|0] request en-US open-ils.cstore.direct.config.org_unit_setting_type.retrieve ["lib.info_url",{"flesh_fields":{"coust":["view_perm"]},"flesh":1}]
open-ils.cstore 2013-07-17 15:53:35 [INFO:20269:osrf_application.c:1059:137408273620311128] CALL: open-ils.cstore open-ils.cstore.direct.config.org_unit_setting_type.retrieve "lib.info_url",{"flesh_fields":{"coust":["view_perm"]},"flesh":1}
open-ils.cstore 2013-07-17 15:53:35 [INFO:20269:osrf_app_session.c:1017:137408273620311128] [open-ils.cstore] sent 716 bytes of data to <email address hidden>/client_at_jasondev.mvlcstaff.org_20311
open-ils.cstore 2013-07-17 15:53:35 [INFO:20269:osrf_stack.c:163:137408273620311128] Message processing duration 0.002257
[2013-07-17 15:53:35] /usr/sbin/apache2 [INFO:20311:CStoreEditor.pm:114:137408273620311128] editor[0|0] request en-US open-ils.cstore.json_query.atomic {"from":["actor.org_unit_ancestor_setting","lib.info_url",""]}
open-ils.cstore 2013-07-17 15:53:35 [INFO:20270:osrf_application.c:1059:137408273620311129] CALL: open-ils.cstore open-ils.cstore.json_query.atomic {"from":["actor.org_unit_ancestor_setting","lib.info_url",""]}
open-ils.cstore 2013-07-17 15:53:35 [ERR :20270:oils_sql.c:5585:137408273620311129] open-ils.cstore: Error with query [SELECT * FROM actor.org_unit_ancestor_setting( 'lib.info_url', '' ) AS "actor.org_unit_ancestor_setting" ;]: 0 ERROR: invalid input syntax for integer: ""
LINE 1: ... actor.org_unit_ancestor_setting( 'lib.info_url', '' ) AS "a...
                                                             ^

open-ils.cstore 2013-07-17 15:53:35 [INFO:20270:osrf_app_session.c:1017:137408273620311129] [open-ils.cstore] sent 213 bytes of data to <email address hidden>/client_at_jasondev.mvlcstaff.org_20311
open-ils.cstore 2013-07-17 15:53:35 [WARN:20270:osrf_application.c:839:137408273620311129] Returning method exception with message: An unknown server error occurred
open-ils.cstore 2013-07-17 15:53:35 [INFO:20270:osrf_app_session.c:1017:137408273620311129] [open-ils.cstore] sent 193 bytes of data to <email address hidden>/client_at_jasondev.mvlcstaff.org_20311
open-ils.cstore 2013-07-17 15:53:35 [INFO:20270:osrf_stack.c:163:137408273620311129] Message processing duration 0.003230
[2013-07-17 15:53:35] /usr/sbin/apache2 [ERR :20311:CStoreEditor.pm:114:137408273620311129] editor[0|0] request error open-ils.cstore.json_query.atomic : {"from":["actor.org_unit_ancestor_setting","lib.info_url",""]} : Exception: OpenSRF::DomainObject::oilsMethodException 2013-07-17T15:53:35 OpenILS::Utils::CStoreEditor /usr/local/share/perl/5.14.2/OpenILS/Utils/CStoreEditor.pm:440 <500> Severe query error -- see error log for more details
[2013-07-17 15:53:35] /usr/sbin/apache2 [ERR :20311:EX.pm:66:137408273620311129] Exception: OpenSRF::DomainObject::oilsMethodException 2013-...

Read more...

Revision history for this message
Kathy Lussier (klussier) wrote :

We're getting good results from this branch now. I configured the library settings in the following manner:

* I added a URL for one branch
* I added a URL for one system, with the expectation that all child branches would link to the same URL.
* I added a URL for a system, but then added another URL for a child branch, with the expectation that all other branches in the system would use that system-level URL while the one branch would point to its own URL.
* All other org units were left without a URL.

I tested in the public catalog, in the staff client catalog and in the kids catalog. Everything worked as expected. Release notes are included, so I'm signing off at:

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

tags: added: signedoff
Revision history for this message
Dan Scott (denials) wrote :

Thanks, Kathy and Jason. I've wrapped the upgrade script and committed this to master!

Changed in evergreen:
status: New → Fix Committed
Ben Shum (bshum)
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.