Comment 6 for bug 874449

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Tested the site() search on a 2.7.1 system and can confirm that anything but a correct org unit shortname/Policy Code results in an Internal Server Error.

It does look like there is no validation of the site value in
http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm;h=19f3a258e90b21c2d462fb0f360de9829270c117;hb=HEAD#l134

151 if(!$site) {
152 ($site) = ($query =~ /site\(([^\)]+)\)/);
153 $site ||= $ctx->{aou_tree}->()->shortname;
154 }

What would be the most sane thing to do if the value of site isn't valid? Set to the current default org. Set to 1.

It seems like there should be a check to see if the site value is an int, if it is then look up that org unit and replace $site with the shortname. If the lookup fails then treat the value as a shortname and check it for validity. No reason a shortname couldn't be a number right? Then if that fails, set to the default, or just unset site so it acts like it isn't there.