Przeglądaj źródła

Bugfix. Could not render chat room configuration form.

JC Brand 10 lat temu
rodzic
commit
3bf5eeb4a8
2 zmienionych plików z 6 dodań i 4 usunięć
  1. 5 4
      converse.js
  2. 1 0
      docs/CHANGES.rst

+ 5 - 4
converse.js

@@ -2410,14 +2410,15 @@
                 var $form= this.$el.find('form.chatroom-form'),
                     $stanza = $(stanza),
                     $fields = $stanza.find('field'),
-                    title = $stanza.find('title').text();
+                    title = $stanza.find('title').text(),
+                    instructions = $stanza.find('instructions').text();
                 $form.find('span.spinner').remove();
                 $form.append($('<legend>').text(title));
-                if (instructions != title) {
-                    $form.append($('<p class="instructions">').text(this.instructions));
+                if (instructions && instructions != title) {
+                    $form.append($('<p class="instructions">').text(instructions));
                 }
                 _.each($fields, function (field) {
-                    $form.append(utils.xForm2webForm(field));
+                    $form.append(utils.xForm2webForm($(field), $stanza));
                 });
                 $form.append('<input type="submit" value="'+__('Save')+'"/>');
                 $form.append('<input type="button" value="'+__('Cancel')+'"/>');

+ 1 - 0
docs/CHANGES.rst

@@ -5,6 +5,7 @@ Changelog
 ------------------
 
 * Bugfix. Login panel didn't appear under certain conditions. [jcbrand]
+* Bugfix. Error when trying to render chat room configuration form. [jcbrand]
 * Text on the registration form was not configurable or i18n aware. [jcbrand]
 * #285 With prebind the jid, rid and sid settings were ignored. [jcbrand]