If there are extra fields which are used in more than one pane (for example in Delivery and in Billing), only one of these instances is available in Views as a field. For example: although there is Delivery phone and Billing phone, only the Billing phone is available as View field/filter.

The reason is incorrect object assignment in function uc_extra_fields_pane_views_get_fields(), which causes that previous elements of generated array are overwritten in subsequent iterations.

Comments

ivan.vujovic’s picture

Here is the patch which should solve this problem.

megachriz’s picture

Status: Active » Fixed

Your patch is committed. Thanks for catching!

Previously (in the alpha version), the fields were reloaded for each pane, but in beta1 the API was redesigned to make sure fields are only loaded once from the database. This had indeed consequences for the Views implementation which I didn't had realized.

igor.ro’s picture

Hello.
MegaChriz should not we use
$fields[$pane_type][$fieldname] = drupal_clone($field);
instead of
$fields[$pane_type][$fieldname] = clone $field;
?

Thanks.

megachriz’s picture

@igor.ro
No, we don't need that. drupal_clone() is used to get code compatible with both PHP 4 and PHP 5. Extra Fields Pane only supports PHP 5. But thanks for your suggestion.

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