Within gallerix_admin_settings() in management.inc, should use "#default_value" instead of "#value for $entry['name'].

Also, the name check should also check name for "original".

Comments

AlexisWilke’s picture

Status: Active » Fixed

Ah! That would explain. 8-)

I checked in your fix and tweaked the validation function a bit too.

Thank you!
Alexis Wilke

bmstak’s picture

Status: Fixed » Active

Need to set the #value for thumbnail and the internal name should be locked once it has been created.

    $entry['name'] = array(
      '#type' => 'textfield',
      '#size' => 20,
    );
    
    if ( $name == '' )
    {
      $entry['name']['#disabled'] = FALSE;
    } else
    {
      $entry['name']['#value']  = $name;
      $entry['name']['#disabled'] = TRUE;
    }
AlexisWilke’s picture

Tak,

The #disabled is already set now. Are you saying that if disabled we MUST have #value for the name and not #default_value? I would think that the #disabled should do its work...

Is "frame" what you call the internal name or would there be another? Because your test uses if ($name == '') which seems wrong to me. The two internal names and #disabled are already checked in.

Thank you.
Alexis

AlexisWilke’s picture

I guess there is a big mix-up with the last 3 issues here... 8-}

I put a fix in. I see that you set disabled on $name = '', which means only allow new names, never allow editing of an existing name. Was that really your intend?

Thank you.
Alexis

bmstak’s picture

Alexis,

Yes, that was my intention. Disable changing the name once that name is set.

Tak.

AlexisWilke’s picture

Version: 6.x-1.x-dev » 6.x-1.5
Status: Active » Fixed

Please, feel free to re-open if it doesn't work the way you think it should. 1.5 includes most of these changes.

Thank you.
Alexis Wilke

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.