I created a new link field on my registration form with the no title option. However, the title field still appears on the form.

Comments

burki’s picture

This seems to be a problem in the link_field_process function. The settings array that is taken from form_state is not initialized.

Proposal for a fix:

//$settings = &$form_state['field'][$element['#field_name']][$element['#language']]['instance'
$instance = field_widget_instance($element, $form_state);
$settings = $instance['settings'];
jcfiala’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not able to reproduce - I created a node type, added a link field and selected the 'no title' option - I'm seeing no title field on the form. Can you give me some more information about the field that could help me reproduce your problem?

rwohleb’s picture

Status: Postponed (maintainer needs more info) » Active

I'm getting this also. I am seeing it when I attach a link field to a profile2 content type. It appears it's due to how profile2 merges it's attached fields into profile forms. As a result, you can't guarantee a specific structure for $form_state['field'].

Based on the description of field_widget_instance() on api.d.o it looks like that's the proper way to get to field instance settings anyways. The change in #1 works for me.

jcfiala’s picture

Status: Active » Fixed

Hm. I'll have to agree, it does look like I should be using field_widget_instance. Thank you for pointing that out.
I've pushed the change into git.

Status: Fixed » Closed (fixed)

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

Niklas Fiekas’s picture

meabbasi’s picture

Subscribing.

dqd’s picture

Please read project page:

INFO 1: DRUPAL 7 - It is strongly recommended to use latest 7.x-1.x-dev release, since there are already most issues of alpha-release fixed. Please use the issue queue mainly for reports on latest 7.x-1.x-dev to get forward with final Drupal 7 release. Thanks.

here a snapshot of working 7.x-1.x-dev below