TPac: Avoid long-running, unintended empty searches
authorBill Erickson <berick@esilibrary.com>
Mon, 23 Jan 2012 20:00:45 +0000 (15:00 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 31 Jan 2012 19:29:01 +0000 (14:29 -0500)
commit12a0c69da19bd323b13695e655116dc605d12cb8
treed46033a75b0526f246f1dabf8f0943a0f2e02017
parentd165b4ed70d06b4170f4e24cd75a2b31c6fdcc05
TPac: Avoid long-running, unintended empty searches

If a page that executes a search is accessed with no viable search
query, cut the search short to avoid meaningless, long-running searches.
This primarily affects direct links to record detail pages.  For
example:

http://example.org/eg/opac/record/123

The RD page attempts to load the currrently active search (for paging) and,
if there is no query, will search for strings like 'site(BR1) depth(2)',
which are unintended and quite slow, which delays page rendering.

---

While we're in there, let's silence the following Apache error log
warning by ensuring that int() gets a value.

Use of uninitialized value in int at
/usr/local/share/perl/5.10.1/OpenILS/WWW/EGCatLoader/Search.pm line 192.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm