A platform for community discussion. Free, open, simple.
FIX: Don't lock wiki posts when they're edited
Robin Ward17a615165c1d
diff --git a/lib/post_revisor.rb b/lib/post_revisor.rbindex 22fa2dd0e06..6e024a4c016 100644--- a/lib/post_revisor.rb+++ b/lib/post_revisor.rb@@ -169,6 +169,7 @@ class PostRevisor# Lock the post by default if the appropriate setting is trueif (SiteSetting.staff_edit_locks_post? &&+ [email protected]? &&@fields.has_key?('raw') &&@editor.staff? &&diff --git a/spec/components/post_revisor_spec.rb b/spec/components/post_revisor_spec.rbindex 82a239677e4..b8be5cf46ec 100644--- a/spec/components/post_revisor_spec.rb+++ b/spec/components/post_revisor_spec.rb@@ -452,6 +452,16 @@ describe PostRevisor doexpect(post).to be_lockedend+ it "doesn't wiki posts" do+ post.wiki = true+ result = subject.revise!(+ moderator,+ raw: "some new raw content"+ )+ expect(result).to eq(true)+ post.reload+ expect(post).not_to be_locked+ endit "doesn't lock the post when the raw did not change" doresult = subject.revise!(moderator,