We noticed that the results of an advanced search by barcode would not
display the "add to bookbag" extra actions selector when users were
logged in. I tracked it down far enough to find a correspondence with
the "recordDrawn" event in rdetail.js, and found that calling
rdetailSetExtrasSelector() before running the "recordDrawn" event would
at least show us the bookbags.

There's obviously some other underlying problem that should be fixed,
but this patch against rel_1_6_0 at least fixes this particular problem.
I'm posting the patch here in case someone more familiar with the
intricacies of rdetail.js might spot the real problem; I'll apply the
patch to trunk, rel_1_6, and rel_1_6_0 later today (unless someone
speaks up first!)
Index: Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- Open-ILS/web/opac/skin/default/js/rdetail.js	(revision 15652)
+++ Open-ILS/web/opac/skin/default/js/rdetail.js	(working copy)
@@ -427,11 +427,13 @@
 
 	$('rdetail_img_link').setAttribute('href', buildISBNSrc(cleanISBN(record.isbn()), 'large'));
 	G.ui.rdetail.image.setAttribute("src", buildISBNSrc(cleanISBN(record.isbn())));
+
+	// Set extras before recordDrawn event to enable bookbags in barcode searches
+	rdetailSetExtrasSelector();
+
 	runEvt("rdetail", "recordDrawn");
 	recordsCache.push(record);
 
-	rdetailSetExtrasSelector();
-
 	var breq = new Request(FETCH_BRE, [getRid()]);
 	breq.callback( rdetailCheckDeleted );
 	breq.send();

Reply via email to