mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 10:32:08 +08:00
FIX: better edit conflict handling (#29789)
* FIX: better edit conflict handling Properly keep track of the original title and tags when dealing with edit conflicts. Internal ref - t/141218
This commit is contained in:
@ -240,8 +240,9 @@ class PostsController < ApplicationController
|
||||
|
||||
Post.plugin_permitted_update_params.keys.each { |param| changes[param] = params[:post][param] }
|
||||
|
||||
raw_old = params[:post][:raw_old]
|
||||
if raw_old.present? && raw_old != post.raw
|
||||
# keep `raw_old` for backwards compatibility
|
||||
original_text = params[:post][:original_text] || params[:post][:raw_old]
|
||||
if original_text.present? && original_text != post.raw
|
||||
return render_json_error(I18n.t("edit_conflict"), status: 409)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user