A platform for community discussion. Free, open, simple.
FIX: Message for bulk closing topics silently (#27400)
Martin Brennan10b9a32abb99
diff --git a/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjs b/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjsindex acf52cbbce2..2b120f2494c 100644--- a/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/bulk-topic-actions.gjs@@ -87,7 +87,9 @@ export default class BulkTopicActions extends Component {const options = {};if (this.isSilent) {- operation = { type: "silent_close" };+ const newType =+ operation.type === "close" ? "silent_close" : operation.type;+ operation.type = newType;}if (this.isCloseAction && this.closeNote) {diff --git a/app/services/topic_status_updater.rb b/app/services/topic_status_updater.rbindex 0a7f02fb63c..528b67280cd 100644--- a/app/services/topic_status_updater.rb+++ b/app/services/topic_status_updater.rb@@ -13,7 +13,11 @@ TopicStatusUpdater =if updatedhighest_post_number = topic.highest_post_numbercreate_moderator_post_for(status, opts)- update_read_state_for(status, highest_post_number)+ update_read_state_for(+ status,+ highest_post_number,+ silent_tracking: opts[:silent_tracking],+ )endend@@ -90,8 +94,8 @@ TopicStatusUpdater =topic.reloadend- def update_read_state_for(status, old_highest_read)- if status.autoclosed? && status.enabled?+ def update_read_state_for(status, old_highest_read, silent_tracking: false)+ if (status.autoclosed? && status.enabled?) || (status.closed? && silent_tracking)# let's pretend all the people that read up to the autoclose message# actually read the topicPostTiming.pretend_read(topic.id, old_highest_read, topic.highest_post_number)diff --git a/lib/topics_bulk_action.rb b/lib/topics_bulk_action.rbindex daa28c2bb64..d7bcf4ba953 100644--- a/lib/topics_bulk_action.rb+++ b/lib/topics_bulk_action.rb@@ -174,7 +174,12 @@ class TopicsBulkActiondef silent_closetopics.each do |t|if guardian.can_moderate?(t)- t.update_status("autoclosed", true, @user, { message: @operation[:message] })+ t.update_status(+ "closed",+ true,+ @user,+ { message: @operation[:message], silent_tracking: true },+ )@changed_ids << t.idendend