FIX: javascript error when opening rename tag modal

FIX: javascript error when opening rename tag modal

diff --git a/app/assets/javascripts/discourse/controllers/rename-tag.js.es6 b/app/assets/javascripts/discourse/controllers/rename-tag.js.es6
index a7b7c0e..5c97c4d 100644
--- a/app/assets/javascripts/discourse/controllers/rename-tag.js.es6
+++ b/app/assets/javascripts/discourse/controllers/rename-tag.js.es6
@@ -1,16 +1,18 @@
 import ModalFunctionality from "discourse/mixins/modal-functionality";
+import computed from "ember-addons/ember-computed-decorators";
 import BufferedContent from "discourse/mixins/buffered-content";
 import { extractError } from "discourse/lib/ajax-error";
 
 export default Ember.Controller.extend(ModalFunctionality, BufferedContent, {
-  renameDisabled: function() {
+  @computed("buffered.id", "id")
+  renameDisabled(inputTagName, currentTagName) {
     const filterRegexp = new RegExp(this.site.tags_filter_regexp, "g"),
-      newId = this.get("buffered.id")
-        .replace(filterRegexp, "")
-        .trim();
+      newTagName = inputTagName
+        ? inputTagName.replace(filterRegexp, "").trim()
+        : "";
 
-    return newId.length === 0 || newId === this.get("model.id");
-  }.property("buffered.id", "id"),
+    return newTagName.length === 0 || newTagName === currentTagName;
+  },
 
   actions: {
     performRename() {
diff --git a/app/assets/javascripts/discourse/templates/modal/rename-tag.hbs b/app/assets/javascripts/discourse/templates/modal/rename-tag.hbs
index eeb6b95..39d59a1 100644
--- a/app/assets/javascripts/discourse/templates/modal/rename-tag.hbs
+++ b/app/assets/javascripts/discourse/templates/modal/rename-tag.hbs
@@ -1,8 +1,10 @@
 {{#d-modal-body title="tagging.rename_tag"}}
-  <label>
-    <p>{{i18n "tagging.rename_instructions"}}</p>
-    {{input value=buffered.id maxlength=siteSettings.max_tag_length}}
+  <label class="control-label">
+    {{i18n "tagging.rename_instructions"}}
   </label>
+  <div class="controls">
+    {{input value=buffered.id maxlength=siteSettings.max_tag_length}}
+  </div>
 {{/d-modal-body}}
 
 <div class="modal-footer">

GitHub sha: cd3a167c

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there: