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.

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.

#1 profile_copy-support-list-1909476-1.patch2.5 KBzuuperman
PASSED: [[SimpleTest]]: [MySQL] 3,570 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


zuuperman’s picture

2.5 KB
PASSED: [[SimpleTest]]: [MySQL] 3,570 pass(es). View

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

zuuperman’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!


Status: Fixed » Closed (fixed)

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