A platform for community discussion. Free, open, simple.
FIX: correct link in the notification about moved post (#11399)
Krzysztof Kotlareke4d51e5b0aa0
diff --git a/app/models/post_mover.rb b/app/models/post_mover.rbindex 184fd3b9ee0..5ac0a416a5e 100644--- a/app/models/post_mover.rb+++ b/app/models/post_mover.rb@@ -71,7 +71,7 @@ class PostMovercreate_temp_tabledelete_invalid_post_timingsmove_each_post- notify_users_that_posts_have_moved+ create_moderator_post_in_original_topicupdate_statisticsupdate_user_actionsupdate_last_post_stats@@ -438,19 +438,6 @@ class PostMoverUserAction.synchronize_target_topic_ids(posts.map(&:id))end- def notify_users_that_posts_have_moved- enqueue_notification_job- create_moderator_post_in_original_topic- end-- def enqueue_notification_job- Jobs.enqueue(- :notify_moved_posts,- post_ids: post_ids,- moved_by_id: user.id- )- end-def create_moderator_post_in_original_topicmove_type_str = PostMover.move_types[@move_type].to_smove_type_str.sub!("topic", "message") if @move_to_pm@@ -538,6 +525,12 @@ class PostMoverdef enqueue_jobs(topic)@post_creator.enqueue_jobs if @post_creator+ Jobs.enqueue(+ :notify_moved_posts,+ post_ids: post_ids,+ moved_by_id: user.id+ )+Jobs.enqueue(:delete_inaccessible_notifications,topic_id: topic.iddiff --git a/spec/models/post_mover_spec.rb b/spec/models/post_mover_spec.rbindex aebfefe12d0..018c850a3e2 100644--- a/spec/models/post_mover_spec.rb+++ b/spec/models/post_mover_spec.rb@@ -75,6 +75,7 @@ describe PostMover donotification = p2.user.notifications.where(notification_type: Notification.types[:moved_post]).firstexpect(notification.topic_id).to eq(p2.topic_id)+ expect(notification.topic_id).not_to eq(old_topic_id)expect(notification.post_number).to eq(1)# no message for person who made the move@@ -84,6 +85,7 @@ describe PostMover donotification = p6.user.notifications.where(notification_type: Notification.types[:moved_post]).firstexpect(notification.topic_id).to eq(p2.topic_id)+ expect(notification.topic_id).not_to eq(old_topic_id)# this is the 3rd post we movedexpect(notification.post_number).to eq(3)@@ -541,7 +543,7 @@ describe PostMover do# Should notify correctlynotification = p2.user.notifications.where(notification_type: Notification.types[:moved_post]).first- expect(notification.topic_id).to eq(p2.topic_id)+ expect(notification.topic_id).to eq(destination_topic.id)expect(notification.post_number).to eq(p2.post_number)# Should update last reads@@ -1145,6 +1147,7 @@ describe PostMover donotification = p2.user.notifications.where(notification_type: Notification.types[:moved_post]).firstexpect(notification.topic_id).to eq(p2.topic_id)+ expect(notification.topic_id).not_to eq(old_message_id)expect(notification.post_number).to eq(1)# no message for person who made the move