Bug 23680: Incorrect conversion of Perl boolean to js
authorDavid Gustafsson <david.gustafsson@ub.gu.se>
Thu, 26 Sep 2019 09:50:14 +0000 (11:50 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 14 Nov 2019 13:00:13 +0000 (14:00 +0100)
commit9c07acd0cca79b703a7d979814ef627872d72a35
tree0a5b753177371f1cd48d08c552b2f2897b3ff40f
parent1ad984a90ab1bd4d5b7b12714af1539326c667de
Bug 23680: Incorrect conversion of Perl boolean to js

A Perl boolean value is on the server side converted
to a JS string (resulting in the values '0' or '1).
Since the string '0' is a truthy value in JS this
incorrectly triggers window.close() on the client
in many instances, for example when adding a new item.

To test:

1. Go to a bibliographic record in the staff client.
2. Expand the "New" menu and open "New item" in new tab.
3. The new tab will immediately close.
4. Apply the patch.
5. Perform steps 1-2 again.
6. The tab should now remain open.

Sponsored-by: Gothenburg University Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b488527ebeb3b335854f2290aa1c6cf80f464eb0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc