Bug 34726 - Clicking the title of a record in cart creates URL with duplicate query strings
Summary: Clicking the title of a record in cart creates URL with duplicate query strings
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords:
Depends on: 34725
Blocks:
  Show dependency treegraph
 
Reported: 2023-09-06 07:00 UTC by David Cook
Modified: 2024-09-04 23:51 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2023-09-06 07:00:50 UTC
If you click a title in the OPAC cart, it will create a URL like the following:

http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=114?biblionumber=114

This is because of competing functionality in the template and the Javascript. The output of the following "biblio_a_href" is fed into "openBiblio". 

koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc
[% BLOCK biblio_a_href -%]
    [%- IF Koha.Preference('BiblioDefaultView') == 'marc' -%]
        [%- SET this_biblio_href = "/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=" -%]
    [%- ELSIF Koha.Preference('BiblioDefaultView') == 'isbd' -%]
        [%- SET this_biblio_href = "/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=" -%]
    [%- ELSE -%]
        [%- SET this_biblio_href = "/cgi-bin/koha/opac-detail.pl?biblionumber=" -%]
    [%- END -%]
    [%- this_biblio_href | url %][% biblionumber | url -%]
[%- END %]


koha-tmpl/opac-tmpl/bootstrap/js/basket.js
function openBiblio(dest,biblionumber) {
    var openerURL = dest + "?biblionumber=" + biblionumber;
    opener.document.location = openerURL;
    opener.focus();
}
Comment 1 David Cook 2023-09-06 07:03:56 UTC
Since openBiblio is only used in opac-basket.tt, I think we should change how it works.

It's an easy enough change to make.
Comment 2 David Cook 2023-09-06 07:04:13 UTC
Note that the duplicate query strings don't create a functional problem, but it's still wrong.
Comment 3 David Cook 2024-09-04 23:51:32 UTC
Sometimes I forget just how many bug reports I've opened 🤣