From: Galen Charlton Date: Tue, 14 Jan 2014 16:00:38 +0000 (-0500) Subject: LP#1269042: prevent acq seach from building dropdown of every copy ID in the DB X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=15d6d02117dbae3cf7370d124a75734f4a7740dc;p=working%2FEvergreen.git LP#1269042: prevent acq seach from building dropdown of every copy ID in the DB This patch ensures that if a user sets a search field in the acquisitions general search form to the line item details copy ID (labeled "LID - Evergreen Copy ID"), the form presents a normal input widget rather than trying to build a drop-down containing every copy ID in the database. Except for very small databases, the previous behavior would mean that an open-ils.pcrud backend would eventually consume a great deal of memory trying to service a request for all copies in the system. Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/web/js/ui/default/acq/search/unified.js b/Open-ILS/web/js/ui/default/acq/search/unified.js index 1eaad19c81..926662fa1f 100644 --- a/Open-ILS/web/js/ui/default/acq/search/unified.js +++ b/Open-ILS/web/js/ui/default/acq/search/unified.js @@ -159,10 +159,13 @@ function TermSelectorFactory(terms) { ); } else if (term.hint == "acqlia" || (term.hint == "jub" && term.field == "eg_bib_id") || + (term.hint == "acqlid" && term.field == "eg_copy_id") || (term.datatype == "link" && target == "au")) { - /* The test for jub.eg_bib_id is a special case to prevent - * AutoFieldWidget from trying to render a ridiculous dropdown - * of every bib record ID in the system. */ + /* The tests for jub.eg_bib_id and acqlid.eg_copy_id are + * special cases to prevent AutoFieldWidget from trying + * to render a ridiculous dropdown of every bib or copy + * record ID in the system. + */ wStore[widgetKey] = dojo.create( "input", {"type": "text"}, parentNode, "only" );