Hi,

when I creating products, but using different tokens then "combination", I am getting the following errors:

"Notice: Undefined index: combination in commerce_bpc_tokens() (line 66 of /home/farmerpa/public_html/sites/all/modules/commerce_bpc/commerce_bpc.tokens.inc).
Warning: Invalid argument supplied for foreach() in commerce_bpc_commerce_bpc_tokens() (line 100 of /home/farmerpa/public_html/sites/all/modules/commerce_bpc/commerce_bpc.hooks_list.inc).
Notice: Undefined index: values in commerce_bpc_tokens() (line 67 of /home/farmerpa/public_html/sites/all/modules/commerce_bpc/commerce_bpc.tokens.inc).
Warning: Invalid argument supplied for foreach() in commerce_bpc_tokens() (line 67 of /home/farmerpa/public_html/sites/all/modules/commerce_bpc/commerce_bpc.tokens.inc).
Notice: Undefined index: labels in commerce_bpc_tokens() (line 72 of /home/farmerpa/public_html/sites/all/modules/commerce_bpc/commerce_bpc.tokens.inc).
Warning: Invalid argument supplied for foreach() in commerce_bpc_tokens() (line 72 of /home/farmerpa/public_html/sites/all/modules/commerce_bpc/commerce_bpc.tokens.inc)."

My recommendation is: don't suppose the "combination" token as a necessary one.

Comments

sven.lauer’s picture

The "combination" token is not taken to be necessary ... it works like any other token. So the problem must be something else ... a hunch: Are you using a list field that has "0" as the value?

Dave Kopecek’s picture

Issue summary: View changes

I am having the same issue. The site seems to correctly create the requested products, but the errors display.

commerce_bpc_tokens() is calling commerce_bpc_tokens_by_product_type() which in turn fires commerce_bpc_commerce_bpc_tokens().

Not sure if it matters, but my product type SKU pattern is set to override the default and looks like this:
[bulk_defaults:entered_sku]--[bulk_product:field_a-value]-[bulk_product:field_b-value]-[bulk_product:field_c-value]-[bulk_product:field_d-value]

If I bulk create a single item commerce_bpc_tokens() gets called multiple times. Most times when it is called $bulk_data contains a 'combination' element, however it is called TWICE where the 'combination' element is not present. These two cause the rest of the errors.