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.
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.
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 git.evergreen- ils.org/ ?p=Evergreen. git;a=blob; f=Open- ILS/src/ perlmods/ lib/OpenILS/ WWW/EGCatLoader /Search. pm;h=19f3a258e9 0b21c2d462fb0f3 60de9829270c117 ;hb=HEAD# l134
http://
151 if(!$site) { ([^\)]+ )\)/); aou_tree} ->()->shortname ;
152 ($site) = ($query =~ /site\(
153 $site ||= $ctx->{
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.