Bug 36838 - Can't approve or reject tags in the staff interface
Summary: Can't approve or reject tags in the staff interface
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 34478
Blocks:
  Show dependency treegraph
 
Reported: 2024-05-13 13:39 UTC by Owen Leonard
Modified: 2024-05-22 12:54 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00
Circulation function:


Attachments
Bug 36838: Add CSRF token to tags review AJAX requests (1.94 KB, patch)
2024-05-13 13:51 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36838: Add CSRF token to tags review AJAX requests (2.01 KB, patch)
2024-05-13 13:54 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2024-05-13 13:39:55 UTC
The AJAX-driven operations on the tags review page are not working following the CSRF work. The console shows a 403 error and the logs show "No CSRF token passed for POST"
Comment 1 Owen Leonard 2024-05-13 13:51:42 UTC
Created attachment 166638 [details] [review]
Bug 36838: Add CSRF token to tags review AJAX requests

The JavaScript for approving or rejecting tags in the staff interface's
tag review interface lacked a CSRF token for the POSTed requests. This
patch adds the token for "approve" and "reject" operations.

To test, apply the patch and clear your browser cache if necessary.

- If necessary, enable tags in system preferences.
- Log in to the OPAC and submit multiple tags on various records.
- In the staff interface, go to Tools -> Tags.
- Test the process of approving and rejecting tags by clicking the
  buttons in each row of the table of tags.
- The browser console should show no errors, and the lists of approved
  and rejected tags should correctly show the tags you moderated.
Comment 2 Jonathan Druart 2024-05-13 13:54:34 UTC
Created attachment 166639 [details] [review]
Bug 36838: Add CSRF token to tags review AJAX requests

The JavaScript for approving or rejecting tags in the staff interface's
tag review interface lacked a CSRF token for the POSTed requests. This
patch adds the token for "approve" and "reject" operations.

To test, apply the patch and clear your browser cache if necessary.

- If necessary, enable tags in system preferences.
- Log in to the OPAC and submit multiple tags on various records.
- In the staff interface, go to Tools -> Tags.
- Test the process of approving and rejecting tags by clicking the
  buttons in each row of the table of tags.
- The browser console should show no errors, and the lists of approved
  and rejected tags should correctly show the tags you moderated.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Katrin Fischer 2024-05-13 14:26:58 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 4 Fridolin Somers 2024-05-22 12:54:25 UTC
Depends on Bug 34478 not in 23.11.x