From 40b8e359f321f03dfc5a24f2897247ddd2cc714a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 6 Feb 2024 15:54:38 +0100 Subject: [PATCH] Bug 34478: Fix opac-tags and tags/lists Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt | 10 +++++++++- koha-tmpl/opac-tmpl/bootstrap/js/tags.js | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt index 357b159eb5..7c07c8d87d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt @@ -80,7 +80,15 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %][% ELSE %]This record has no items.[% END %] -
+ +
+ [% INCLUDE 'csrf-token.inc' %] + + + + +
+ [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/tags.js b/koha-tmpl/opac-tmpl/bootstrap/js/tags.js index b7b7612c8e..6e2e81b1b1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/tags.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/tags.js @@ -17,6 +17,8 @@ KOHA.Tags = { var mytagid = "#" + mynewtag; var mydata = {}; mydata[mynewtag] = tag; + mydata['csrf_token'] = $('meta[name="csrf-token"]').attr('content') + mydata['op'] = 'cud-add'; var response; // AJAX from server will assign value to response. $.post( "/cgi-bin/koha/opac-tags.pl", @@ -74,6 +76,8 @@ KOHA.Tags = { var mynewtag = "newtag" + bibarray[i]; mydata[mynewtag] = tag; } + mydata['csrf_token'] = $('meta[name="csrf-token"]').attr('content') + mydata['op'] = 'cud-add'; var response; // AJAX from server will assign value to response. $.post( "/cgi-bin/koha/opac-tags.pl", -- 2.39.5