I tried to set a default context for a field instance, but no matter what I tried, the default never showed up as the default value in the context field. After doing some digging, I found that the default wasn't being passed into $items in the hook_field_widget_form. The default is in $instance. I created a patch that sets the default from $instance if $items is empty. Let me know if there's a better way to do this.

Cheers,
nielsonm

Comments

nielsonm’s picture

Patch posted.

nielsonm’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
tirdadc’s picture

Assigned: Unassigned » tirdadc
Status: Active » Fixed

Tested without the patch and then applied it. Works great, and it's committed. Also removed some old cruft on that form element. Thanks again!

Status: Fixed » Closed (fixed)

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