[Koha-bugs] [Bug 28196] In page anchors on additem.pl don't always go to the right place

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 23 21:24:32 CEST 2021


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

Phil Ringnalda <phil at chetcolibrary.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |phil at chetcolibrary.org

--- Comment #4 from Phil Ringnalda <phil at chetcolibrary.org> ---
Since we don't support Internet Explorer, why not use the URL object, and let
it do the work of parsing for you?

Something like (untested, so I'll probably typo something)

let parsedurl = new URL($(this).attr('href'));
parsedurl.searchParams.set('searchid',me.searchid);
window.location = parsedurl.href;

Bonus advantage: if searchParams.set() sees that someone has screwed up and the
URL already has two searchid params in it, it'll set one and delete the other,
while doing it by hand would be adding a third.

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


More information about the Koha-bugs mailing list