[Koha-bugs] [Bug 30653] New: "Check out" search with one result does not redirect to checkout

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 29 14:37:26 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30653

            Bug ID: 30653
           Summary: "Check out" search with one result does not redirect
                    to checkout
 Change sponsored?: ---
           Product: Koha
           Version: 21.11
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Circulation
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: magnus at libriotech.no
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at gmail.com, kyle.m.hall at gmail.com

I am seeing this on 21.11.04. I go to the front page of the intranet. The
"Check out" tab of the header search is active as default. I type my name into
the search box and press enter. This takes me to this page: 

/cgi-bin/koha/members/member.pl?quicksearch=1&circsearch=1&searchmember=magnus%20enger

This page shows one result, and the "Card" column links to:

/cgi-bin/koha/circ/circulation.pl?borrowernumber=1

while the "Name" column links to:

/cgi-bin/koha/members/moremember.pl?borrowernumber=1

If I choose my name in the typeahead/dropdown that appears below the search
box, I am taken to this page:

/cgi-bin/koha/circ/circulation.pl?borrowernumber=1

Then I do the same thing in 21.05.05: Type my name in the "Check out" box and
press Enter. There I am taken directly to:

/cgi-bin/koha/circ/circulation.pl

(This is a POST, so borrowernumber=1 is not visible in the URL). 


Looking more closely at the source of
/cgi-bin/koha/members/member.pl?quicksearch=1&circsearch=1&searchmember=magnus%20enger
in 21.11.04 I do see this: 

                    $.ajax({
                        'dataType': 'json',
                        'type': 'POST',
                        'url': sSource,
                        'data': aoData,
                        'success': function(json){
                            // redirect if there is only 1 result.
                            if ( json.aaData.length == 1 &&
aoData.iDisplayStart == 0 ) {
                                var borrowernumber =
json.aaData[0].borrowernumber;
                                /* Overwrite history state of firstletter
search since only one result was returned; This prevents a loop upon clicking
back */
                                history.replaceState( {}, null,
window.location.href.split("?" )[0]);
                               
document.location.href="/cgi-bin/koha/circ/circulation.pl?borrowernumber="+borrowernumber;
                                return false;
                            }
                            fnCallback(json);
                        }
                    });

This seems to incorporate the fix from bug 29411, but it does not seem to be
working. There is nothing in the console.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list