Right now, ignore required field, as can't really populate the field with the current value as the current value is sometimes hashed (though could for plain text storage..) and I think core doesn't use default value for cck verifcation form.

So there's two thoughts on this

Pass in required, password would have to be renetered on node edit

Required if value is empty, don't offer the weird delete checkbox I currently do.

Hm, I could see both being useful.

Comments

jasonsafro’s picture

I got around the required issue with:

                // Only show password field on node creation
                if( isset($form['nid']['#value']) && !empty($form['nid']['#value']) ) {
                    $form['field_war_password']['#access'] = FALSE;
                } else {
                    $form['field_war_password'][0]['#required'] = TRUE;
                }

That makes the field required only on initial creation. It also hides the field on edit pages b\c I needed that for another reason.

hefox’s picture

Status: Active » Fixed

Commited ...some handling of required. It's a bit weird but it's trying to handle the various cases (multi, single values, etc.). Required when value empty and delta=0 and set to be required, otherwise not required

Status: Fixed » Closed (fixed)

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