Drupal 4.7.0 and 4.7.1 htmlarea with xinha-nightly freeze in firefox (1.5.0.3) while editing nodes
with more than one textarea. Drupal 4.7 has two textareas, 'edit-body' and 'edit-log'
(I have had the same issue with drupal 4.6 in the past )

I can stop the freeze by getting htmlarea to skipping the edit-log textarea to ignore the edit-log textarea
by adding

        if ('log' == $key) {
        	continue;  //skip this key
        }

in htmlarea.module: htmlarea_form_alter()

see full function.

function htmlarea_form_alter($form_id, &$form) {
  global $htmlarea_init, $htmlarea_fields, $htmlarea_codeview;

  foreach (element_children($form) as $key) {
    switch ($form[$key]['#type']) {
      case 'textarea':
        $name = 'edit-';
        if ($form[$key]['#parent']) {
          $name.= implode('-', $form[$key]['#parent']) .'-';
        }
        if ('log' == $key) {
        	continue;  //skip this key
        }
        $name.= $key;
        $jsname = strtr($name, '- ', '_ ');
        if (_htmlarea_is_changed($name)) {
          $htmlarea_init[] = "var $jsname = null;";
          if (!$htmlarea_codeview) {
            $htmlarea_fields[] = "  attacheditor($jsname, '$name');";
            $form[$key]['#attributes']['editor'] = 'xinha';
            $form[$key]['#resizable'] = false;

            /* Xinha doesn't work very well in a collapsed fieldset so we
             * will set the #collapsed to false so that it will be set up to
             * the correct size */
            if ($form['#type'] == 'fieldset' && $form['#collapsed']) {
              $form['#collapsed'] = false;
            }
          }
        }
    }
    if (count(element_children($form[$key]))) {
      htmlarea_form_alter($form_id, $form[$key]);
    }
  }
}

Comments

gordon’s picture

Status: Active » Fixed

This has been fixed in 5+

Anonymous’s picture

Status: Fixed » Closed (fixed)