[Koha-devel] Need help with bug 26247

Mark Alexander marka at pobox.com
Wed May 4 14:10:56 CEST 2022


After spending time in the browser debugger, I have more information.

1. The keep_text function in staff-global.js only gets called when
you click on the "Check out", "Check in", or "Renew" links under
the search box; that is, when you change the type of search you
desire.  But that is not the situation I'm talking about in
our library's workflow.  We select "Search the catalog" and
then repeatedly enter barcodes in the search box.  In that situation,
keep_text never gets called, and the last search string (the
last barcode) persists and has to be erased manually after
each submit.

2. I have disabled the code in search.pl that fills in the search
box by this trick:

  # if a simple search, display the value in the search box
  if (0 && $operands[0] && !$operands[1]) {

But it has no effect.

3. The Javascript snippet that was suggested for IntranetUserJS does
in fact get called.  I verified this by modifying it to put a "bogus"
string in the search box, as follows:

  $(document).ready(function() {
    $("#header_search #catalog_search input[name='q']").val("bogus");
  });

When I put a breakpoint at this function, then step over it, I see the
string "bogus" put into the search box as expected.  But then when I
continue execution, the original search string (a book barcode) is put
into the search box, overwriting "bogus".  This is the mystery I am
trying to solve.

I have tried setting a "break on attribute modifications" breakpoint
on the text input field but it never gets hit.

-- 
I am currently going through a difficult transition period
called "Life". --Ashleigh Brilliant


More information about the Koha-devel mailing list