Bug 43192: Cast escape_str(obj) arg to string to use escapeHtml func
The escape_str function in the OPAC requires the argument to be a string, and will throw a fatal error if passed a Number. This is because String.prototype.escapeHtml is created by Koha and is not a JS standard. This patch converts the object to a string before applying escapeHtml. To test, apply the patch and log in to the OPAC. - If necessary, add a list. - Search for records in the catalog and add one or more of the results to your new list. - Go to Lists -> Your lists. - In the list of your lists, click the "Delete" link for the list you added records to. - You should see a confirmation modal, "Are you sure you want to delete this list?" showing the name of the list and the number of items on it. - Clicking "Yes, delete" should delete the list. Sponsored-by: Athens County Public Libraries Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
0f894cb6b1
commit
32e16ca89a
|
|
@ -50,7 +50,7 @@ String.prototype.escapeHtml = function () {
|
|||
});
|
||||
};
|
||||
function escape_str(s) {
|
||||
return s != null ? s.escapeHtml() : "";
|
||||
return s != null ? s.toString().escapeHtml() : "";
|
||||
}
|
||||
|
||||
function confirmDelete(message) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue