Fix #4241: Approving a post then editing tags returns 404.
This is what happens: * The post is approved. * The approval action reloads the page by calling `location.reload()`. * After the page is reloaded, the value of the hidden `_method` param in the post edit form is mysteriously overwritten with the value of the authenticity_token param from the previous page load. * The post edit form is submitted, but the _method param isn't set to `patch`, so the form submission is treated as a POST request instead of a PUT request. * The POST endpoint doesn't exist, so the form submission returns 404. The cause appears to be buggy form autofill in Firefox 72. This only happens in Firefox 72, not in Firefox 68 or in other browsers.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
<%= render "sources/info" %>
|
||||
|
||||
<%= simple_form_for(post, html: { id: "form" }) do |f| %>
|
||||
<%= simple_form_for(post, html: { id: "form", autocomplete: "off" }) do |f| %>
|
||||
<%= hidden_field_tag :tags_query, params[:q] %>
|
||||
<%= hidden_field_tag :pool_id, params[:pool_id] %>
|
||||
<%= hidden_field_tag :favgroup_id, params[:favgroup_id] %>
|
||||
|
||||
Reference in New Issue
Block a user