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') {
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | commerce_price_flexyformatter-1833416-1.patch | 1.63 KB | imiksu |
Comments
Comment #1
imiksuAttached a patch.
Comment #2
xlyz commentedthis should be fixed with last commit.