Skip to content

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

FIX: Disable insert link button when editing a category (#10549)

Roman Rizzi2a3a173e8ec4
diff --git a/app/assets/javascripts/discourse/app/components/edit-category-topic-template.js b/app/assets/javascripts/discourse/app/components/edit-category-topic-template.js
index 1ccf804dd1b..f36425ebb1a 100644
--- a/app/assets/javascripts/discourse/app/components/edit-category-topic-template.js
+++ b/app/assets/javascripts/discourse/app/components/edit-category-topic-template.js
@@ -3,6 +3,10 @@ import { buildCategoryPanel } from "discourse/components/edit-category-panel";
import { observes } from "discourse-common/utils/decorators";
export default buildCategoryPanel("topic-template", {
+ // Modals are defined using the singleton pattern.
+ // Opening the insert link modal will destroy the edit category modal.
+ showInsertLinkButton: false,
+
@observes("activeTab")
_activeTabChanged: function() {
if (this.activeTab) {
diff --git a/app/assets/javascripts/discourse/app/templates/components/edit-category-topic-template.hbs b/app/assets/javascripts/discourse/app/templates/components/edit-category-topic-template.hbs
index 6b9fa9b84d8..746dc89d048 100644
--- a/app/assets/javascripts/discourse/app/templates/components/edit-category-topic-template.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/edit-category-topic-template.hbs
@@ -1,2 +1,2 @@
<label>{{i18n "category.topic_template"}}</label>
-{{d-editor value=category.topic_template}}
+{{d-editor value=category.topic_template showLink=showInsertLinkButton}}