Bugzilla – Attachment 154724 Details for
Bug 34601
Cannot manage suggestions without CSRF error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34601: Fix edit/delete links on suggestion.tt
Bug-34601-Fix-editdelete-links-on-suggestiontt.patch (text/plain), 3.94 KB, created by
Andrew Fuerste-Henry
on 2023-08-23 21:17:39 UTC
(
hide
)
Description:
Bug 34601: Fix edit/delete links on suggestion.tt
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2023-08-23 21:17:39 UTC
Size:
3.94 KB
patch
obsolete
>From 68ad613233b6a8af89b2db28b06ad149a741cdf0 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 23 Aug 2023 18:18:57 +0000 >Subject: [PATCH] Bug 34601: Fix edit/delete links on suggestion.tt > >1. Make a suggestion >2. Try to edit, delete the suggestion. >3. Error: >4. Apply patch and restart_all >5. Try again and you should not get the error anymore. > >Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> >--- > .../intranet-tmpl/prog/en/modules/suggestion/suggestion.tt | 4 ++-- > suggestion/suggestion.pl | 6 ++++++ > 2 files changed, 8 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index 649874488c2..9fece69d0be 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -845,9 +845,9 @@ > </td> > <td class="actions"> > <div class="btn-group dropup"> >- <a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=[% s.suggestionid | html %]&op=edit"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_[% s.suggestionid | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a> >+ <a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=[% s.suggestionid | html %]&csrf_token=[% csrf_token | html %]&op=edit"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_[% s.suggestionid | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a> > <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% s.suggestionid | html %]"> >- <li><a class="deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% s.suggestionid | html %]"><i class="fa fa-trash-can"></i> Delete</a></li> >+ <li><a class="deletesuggestion" href="suggestion.pl?op=delete&suggestionid=[% s.suggestionid | html %]"&csrf_token=[% csrf_token | html %]><i class="fa fa-trash-can"></i> Delete</a></li> > [% UNLESS s.archived %] > <li><a class="archivesuggestion" href="suggestion.pl?op=archive&suggestionid=[% s.suggestionid | html %]"><i class="fa fa-archive"></i> Archive</a></li> > [% ELSE %] >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 36a9f063af6..d524c856fcd 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -33,6 +33,7 @@ use Koha::Acquisition::Currencies; > use Koha::Libraries; > use Koha::Patrons; > use Koha::Suggestions; >+use Koha::Token; > > use URI::Escape qw( uri_escape ); > >@@ -531,10 +532,15 @@ foreach my $field ( qw(managedby acceptedby suggestedby budgetid) ) { > $hashlists{ lc($field) . "_loop" } = \@codes_list; > } > >+my $csrf_token = Koha::Token->new->generate_csrf({ >+ session_id => scalar $input->cookie('CGISESSID'), >+}); >+ > $template->param( > %hashlists, > borrowernumber => ($input->param('borrowernumber') // undef), > SuggestionStatuses => GetAuthorisedValues('SUGGEST_STATUS'), >+ csrf_token => $csrf_token, > ); > output_html_with_http_headers $input, $cookie, $template->output; > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34601
:
154719
|
154720
|
154724
|
154747
|
154748
|
154762
|
154951
|
156122