Commit 1aabb694 authored by sun's avatar sun

#329410 by sun: Fixed editor not loaded if there is only one input format.

parent cd22694e
......@@ -6,6 +6,7 @@ Wysiwyg x.x-x.x, xxxx-xx-xx
Wysiwyg 6.x-x.x, xxxx-xx-xx
---------------------------
#329410 by sun: Fixed editor not loaded if there is only one input format.
#324366 by sun: Fixed "Illegal offset type" error on custom content-types.
#328948 by sun: Fixed PHP notices when editors are assigned, but not configured.
#327710 by sun: Fixed nicEdit version could not be detected.
......
......@@ -126,7 +126,9 @@ function wysiwyg_process_form(&$form) {
// guidelines, stored in the child 'format'.
$formats = element_children($element);
array_pop($formats);
unset($formats['format']);
if (($key = array_search('format', $formats)) !== FALSE) {
unset($formats[$key]);
}
foreach ($formats as $format) {
// Default to 'none' editor (Drupal's default behaviors).
$editor = 'none';
......@@ -149,8 +151,12 @@ function wysiwyg_process_form(&$form) {
// Use a prefix/suffix for a single input format, or attach to input
// format selector radio buttons.
if (isset($element['format']['guidelines'])) {
$element[$format]['#prefix'] = '<div class="wysiwyg wysiwyg-editor-'. $editor .' wysiwyg-field-'. $field['#id'] . $theme . $extra_class .'">';
$element[$format]['#suffix'] = '</div>';
$element['format']['guidelines']['#prefix'] = '<div class="wysiwyg wysiwyg-editor-'. $editor .' wysiwyg-field-'. $field['#id'] . $theme . $extra_class .'">';
$element['format']['guidelines']['#suffix'] = '</div>';
// Edge-case: Default format contains no input filters.
if (empty($element['format']['guidelines']['#value'])) {
$element['format']['guidelines']['#value'] = ' ';
}
}
else {
if (isset($element[$format]['#attributes']['class'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment