This issue is moot at this point as I've decided to not do this, but figured you may want to be aware of this.

I created a content type that I was then basing a Form off of for user-entered data. I'm using FlexiForm if it's of any help.

Anyway, if I put the token in the field of the CT, it appears fine in the Form (no extra config needed). HOWEVER, if I hide said field (in the Form) it throws an error. (this was a field holding a value for the IP of the current user) Here is the error:

Notice: Undefined index: default_value in field_default_token_default_value_function() (line 71 of [path]\sites\all\modules\field_default_token\field_default_token.module).
Warning: Invalid argument supplied for foreach() in field_default_token_default_value_function() (line 72 of [path]\sites\all\modules\field_default_token\field_default_token.module).

The odd thing was that if I then un-hid the field in the Form, it still gave the error until I removed the field in the Form (regardless of its visible state).

Comments

HunterElliott’s picture

Issue summary: View changes
maximpodorov’s picture

Is your problem specific to FlexiForm?

HunterElliott’s picture

I've only tried using it when hiding a field in a FlexiForm, so I'm not sure if it's doing it in other places.

  • maximpodorov committed 96676d5 on 7.x-1.x
    Issue #2415133 by HunterElliott: Fix Undefined index: default_value...
maximpodorov’s picture

Status: Active » Fixed

The fix is committed.

Status: Fixed » Closed (fixed)

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