Issue #2031529 by Wim Leers, oadaeh: Fixed JavaScript error when submitting a form that has a text_format() selector set to a text format without associated text editor.

8.0.x
webchick 2013-08-06 23:21:26 -07:00
parent 2055c7ed4e
commit 0adcf47245
1 changed files with 4 additions and 1 deletions

View File

@ -60,7 +60,10 @@ Drupal.behaviors.editor = {
if (event.isDefaultPrevented()) {
return;
}
Drupal.editorDetach(field, settings.editor.formats[activeFormatID], 'serialize');
// Detach the current editor (if any).
if (settings.editor.formats[activeFormatID]) {
Drupal.editorDetach(field, settings.editor.formats[activeFormatID], 'serialize');
}
});
});
},