Description
I have 2 profile types that have a 'list (text)' field. When i click on 'My x is the same as y', all the text fields are correctly removed / filled in. But the list field is still visible and not copied.

Fix
In the copy fields, there is a check if the items of a field is an array. For the list type, this is not the case. Add an else state, that handles non array items.
The same is done in the profile pane form.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nils.destoop’s picture

Included a patch that fixes this problem.
It will also fix a notice, when the profile type doesn't have an address field.

nils.destoop’s picture

Status: Active » Needs review
rszrama’s picture

Status: Needs review » Fixed

Excellent find. I had to expand the scope just a little bit to also accommodate multi-value field widgets that use a single form element to collect multiple values, like a multi-value List (text) field. Also, I discovered that the reason your patch works is because Drupal's core Field API is schizophrenic. There's no reason a single value List (text) field should have a scalar items array, even for a single value field. The pattern with pretty much everything else is to use a single value array - but here Drupal follows PHP and invents an exception to the rule just to keep us guessing. : )

Welcome to the committers log!

Commit: http://drupalcode.org/project/commerce.git/commitdiff/769ff5b

Status: Fixed » Closed (fixed)

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