Hi, first, thanks for this great module!

When load a content type settings form, Resizable settings are restored to their default values at least for comment textarea. Which means if I click the submit button, my customized settings are gone.

I'm only using the base module, not the CCK one, cause I only modify comment textarea dimensions.

I guess it has something to do with the following function, nut I have no time now to digg:

function resizable_body_node_type($op, $info) {
  if ($op == 'delete'){
    variable_del('resizable_body_rows_' . $info->type);
    variable_del('resizable_body_cols_' . $info->type);
    variable_del('resizable_body_resizable_' . $info->type);
    variable_del('resizable_body_split_' . $info->type);

    variable_del('resizable_body_crows_' . $info->type);
    variable_del('resizable_body_ccols_' . $info->type);
    variable_del('resizable_body_cresizable_' . $info->type);    
  }

  elseif ($op == 'update'){
    // get old content type variables
    $v1 = variable_get('resizable_body_rows_' . $info->oldtype, 12);
    $v1_5 = variable_get('resizable_body_cols_' . $info->oldtype, 60);
    $v2 = variable_get('resizable_body_resizable_' . $info->oldtype, TRUE);
    $v3 = variable_get('resizable_body_split_' . $info->oldtype, TRUE);

    $v4 = variable_get('resizable_body_crows_' . $info->oldtype, 5);
    $v4_5 = variable_get('resizable_body_ccols_' . $info->oldtype, 60);
    $v5 = variable_get('resizable_body_cresizable_' . $info->oldtype, TRUE);    

    // delete them
    variable_del('resizable_body_rows_' . $info->type);
    variable_del('resizable_body_cols_' . $info->type);
    variable_del('resizable_body_resizable_' . $info->type);
    variable_del('resizable_body_split_' . $info->type);

    variable_del('resizable_body_crows_' . $info->type);
    variable_del('resizable_body_ccols_' . $info->type);
    variable_del('resizable_body_cresizable_' . $info->type);    

    // and rename to new content type variables
    variable_set('resizable_body_rows_' . $info->type, $v1);
    variable_set('resizable_body_cols_' . $info->type, $v1);
    variable_set('resizable_body_resizable_' . $info->type, $v2);
    variable_set('resizable_body_split_' . $info->type, $v3);

    variable_set('resizable_body_crows_' . $info->type, $v4);
    variable_set('resizable_body_ccols_' . $info->type, $v4);
    variable_set('resizable_body_cresizable_' . $info->type, $v5);
  }
}

Comments

George2’s picture

i don't have as much time as i'd like, but i'm guessing only the rows and resizable (grippie/auto etc) options are saved, the col count not being saved for comments. so change the last but one line of the function from:

variable_set('resizable_body_ccols_' . $info->type, $v4);

to

variable_set('resizable_body_ccols_' . $info->type, $v4_5);

if that fixes it, i'll commit it.

jchatard’s picture

Thank you, I'll test this ASAP.

And tell you.

Jérémy

drupalina’s picture

I think the fact that it doesn't work for comments (which I reported here http://drupal.org/node/522804) , is related to the this issue -- namely that it doesn't save the preferences in the resizable comments fieldset. For example , I would like to have "Autoresize with animation", but the settings always default to "Manual - show grippie".

George2’s picture

please download the dev when it's built and try that.

George2’s picture

Status: Active » Closed (fixed)

assuming this is fixed now.

virtualdrupal’s picture

I'm experiencing this same issue on comments, I set the grippie to none, and when I go back and edit the content type it's back to show manual. Using the latest DEV

rkarajgi’s picture

@subscribing. I am experiencing same issue.

betoaveiga’s picture

Me too...