Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The CSRF token is not correctly applied in the Bootstrap 3 'Add Collaborator' page #8201

Open
u10313335 opened this issue Apr 29, 2024 · 2 comments
Assignees

Comments

@u10313335
Copy link
Contributor

CKAN version

CKAN 2.10.X

Describe the bug

The misplaced CSRF token leads to the 400 Bad Request The CSRF token is missing. error in the Bootstrap 3 'Add Collaborator' page.

Steps to reproduce

Navigate to /dataset/collaborators/<dataset_name>/new and add a user as a collaborator.

Expected behavior

The user should be added as a collaborator.

Additional details

The fix should be a simple one:

--- a/ckan/templates-bs3/package/collaborators/collaborator_new.html
+++ b/ckan/templates-bs3/package/collaborators/collaborator_new.html
@@ -10,8 +10,8 @@
     {% block page_heading %}{{ _('Edit Collaborator') if user else _('Add Collaborator') }}{% endblock %}
   </h1>
   {% block form %}
-  {{ h.csrf_input() }}
   <form class="dataset-form add-member-form" method='post'>
+    {{ h.csrf_input() }}
     <div class="row">
       <div class="col-md-5">
         <div class="form-group control-medium">

However, since the BS3 template has been removed from the master branch, where should I submit the PR?

@amercader
Copy link
Member

Hi @u10313335 a PR against dev-v2.10 would be great, thanks!

@u10313335
Copy link
Contributor Author

Thanks @amercader! I have created a pull request to resolve the issue.

wardi added a commit that referenced this issue May 2, 2024
[#8201] Fix misplaced CSRF token in the BS3 collaborator_new.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants