From 23a5c6444af079d4071a74365c757ea34e727eb1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9gis=20Hanol?= <regis@hanol.fr>
Date: Fri, 14 Aug 2015 19:33:32 +0200
Subject: [PATCH] FIX: move topic links and quoted posts extraction to the
 PostRevisor

---
 app/controllers/posts_controller.rb | 5 +----
 lib/post_revisor.rb                 | 3 +++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb
index ea2c3a08f75..4161c360980 100644
--- a/app/controllers/posts_controller.rb
+++ b/app/controllers/posts_controller.rb
@@ -149,10 +149,7 @@ class PostsController < ApplicationController
     end
 
     revisor = PostRevisor.new(post)
-    if revisor.revise!(current_user, changes, opts)
-      TopicLink.extract_from(post)
-      QuotedPost.extract_from(post)
-    end
+    revisor.revise!(current_user, changes, opts)
 
     return render_json_error(post) if post.errors.present?
     return render_json_error(post.topic) if post.topic.errors.present?
diff --git a/lib/post_revisor.rb b/lib/post_revisor.rb
index b19583820d5..6a97b166558 100644
--- a/lib/post_revisor.rb
+++ b/lib/post_revisor.rb
@@ -136,6 +136,9 @@ class PostRevisor
     publish_changes
     grant_badge
 
+    TopicLink.extract_from(@post)
+    QuotedPost.extract_from(@post)
+
     successfully_saved_post_and_topic
   end