htmlArea/xinha firefox freezes (multiple textareas)

farooqsadiq - June 1, 2006 - 17:21
Project:Htmlarea
Version:4.6.x-1.x-dev
Component:User interface
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

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

<?php
       
if ('log' == $key) {
            continue; 
//skip this key
       
}
?>

in htmlarea.module: htmlarea_form_alter()

see full function.

<?php
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]);
    }
  }
}
?>

#1

gordon - January 24, 2007 - 01:00
Status:active» fixed

This has been fixed in 5+

#2

Anonymous - February 7, 2007 - 02:18
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.