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

--- Comment #7 from Eric Phetteplace <[email protected]> ---
This code works since it checks the split array index first before using match:

if (document.referrer.length) {
    const referrerSplit = document.referrer.split(window.location.origin +
'/cgi-bin/koha/cataloguing/additem.pl?')
    if(referrerSplit[1] &&
referrerSplit[1].match(/frameworkcode=FA&circborrowernumber=/) ) {
        let urlParams = new URLSearchParams(window.location.search);
        let barcode = urlParams.get('barcode');
        $('#barcode').val(barcode);
        $('#mainform').submit();
    }
}

Happy to make a patch and apologies if it's uncouth to set back to failed QA
without consulting anyone. I just noticed this console error on our instance
and saw that it wasn't due to referrer being undefined but due to the problem I
stated above.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to