Skip to content

A platform for community discussion. Free, open, simple.

FIX: do not allow posting of category topic template without any changes

Arpit Jalan671ffc4e06c3
diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6
index 903d61b5210..2df885db751 100644
--- a/app/assets/javascripts/discourse/models/composer.js.es6
+++ b/app/assets/javascripts/discourse/models/composer.js.es6
@@ -358,6 +358,17 @@ const Composer = RestModel.extend({
}
}
+ if (topicFirstPost) {
+ // user should modify topic template
+ const category = this.category;
+ if (category && category.topic_template) {
+ if (this.reply.trim() === category.topic_template.trim()) {
+ bootbox.alert(I18n.t("composer.error.topic_template_not_modified"))
+ return true;
+ }
+ }
+ }
+
if (this.privateMessage) {
// need at least one user when sending a PM
return (
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 50b1517c15e..241b7247e8e 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -1626,6 +1626,7 @@ en:
try_like: "Have you tried the {{heart}} button?"
category_missing: "You must choose a category"
tags_missing: "You must choose at least {{count}} tags"
+ topic_template_not_modified: "You have not modified the topic template. Please update the topic."
save_edit: "Save Edit"
overwrite_edit: "Overwrite Edit"