From d165b4ed70d06b4170f4e24cd75a2b31c6fdcc05 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 23 Jan 2012 17:04:01 -0500 Subject: [PATCH] TPac: avoid SMS org setting check for non-SMS pages Avoid an unnecessary org unit setting lookup on a large swath of (mostly myopac) pages. Instead, check to see if the current page is the SMS page in question and the lookup is necessary before making the lookup. This change also inserts the physical location as the first org unit to use in the org setting test. Signed-off-by: Bill Erickson Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index b19b8bc200..0a1fd65a4d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -128,10 +128,10 @@ sub load { ); } - my $org_unit = $self->cgi->param('loc') || $self->ctx->{aou_tree}->()->id; - my $skip_sms_auth = $self->ctx->{get_org_setting}->($org_unit, 'sms.disable_authentication_requirement.callnumbers'); - if ($skip_sms_auth) { - return $self->load_sms_cn if $path =~ m|opac/sms_cn|; + if ($path =~ m|opac/sms_cn| and !$self->editor->requestor) { + my $org_unit = $self->ctx->{physical_loc} || $self->cgi->param('loc') || $self->ctx->{aou_tree}->()->id; + my $skip_sms_auth = $self->ctx->{get_org_setting}->($org_unit, 'sms.disable_authentication_requirement.callnumbers'); + return $self->load_sms_cn if $skip_sms_auth; } # ---------------------------------------------------------------- -- 2.11.0