This bug usually appears when viewing the node and using multiple environments which use different price components (like commerce_coupon, which tends to generate separate component types for each coupon code).

The code assumes that the component name is available, which results into an PHP notice message:

Notice: Undefined index: xxx in function commerce_price_flexyformatter_field_formatter_view() (row 161 in file sites/all/modules/contrib/commerce_price_flexyformatter/commerce_price_flexyformatter.module).
Notice: Undefined index: xxx in function commerce_price_flexyformatter_field_formatter_view() (row 176 in file sites/all/modules/contrib/commerce_price_flexyformatter/commerce_price_flexyformatter.module).

This can be fixed simply by making an isset() check on those lines.

// line 161
- if ($display['settings']['selection'][$component['name']] != '0') {
+ if (isset($display['settings']['selection'][$component['name']]) && $display['settings']['selection'][$component['name']] != '0') {
// line 176
- if ($display['settings']['reference']['selection'][$component['name']] != '0') {
+ if (isset($display['settings']['reference']['selection'][$component['name']]) && $display['settings']['reference']['selection'][$component['name']] != '0') {

Comments

imiksu’s picture

Attached a patch.

xlyz’s picture

Issue summary: View changes
Status: Active » Fixed

this should be fixed with last commit.

Status: Fixed » Closed (fixed)

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