Warning: Missing argument 4 for _options_get_options()...
Warning: Missing argument 5 for _options_get_options()...
Notice: Undefined variable: entity_type in _options_get_options()...
Notice: Undefined variable: entity in _options_get_options()...

This message appears with the Add to Cart form, when a List type field is added to a product entity, and the "Enable this field to function as an attribute field on Add to Cart forms." option is checked on that field.

The function commerce_cart_add_to_cart_form() which invokes _options_get_options() does not provide two required parameters: entity_type and entity.

The following patch provides them via the available $context array provided to commerce_cart_add_to_cart_form().

Comments

helior’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB
helior’s picture

StatusFileSize
new1.02 KB
rszrama’s picture

Status: Needs review » Fixed

I'm not sure the test bot is ever gonna get back to us on this with the tests failing, so I tested locally and committed. : )

joemoraca’s picture

I can verify the fix ;-) installed commerce kickstart 1.7 with commerce 1.2 and had the error using inline entity form (which seems pretty awesome) - updated to the current commerce dev version and the error is gone.

rszrama’s picture

Great, thanks for letting us know, Joe. : )

rowbotony’s picture

Confirm this is fixed in commerce 7.x-1.3 for me. I downloaded commerce_kickstart-1.7, drush up'd to Drupal-7.14, then encountered this error. I then updated commerce-7.x-1.2 to 7.x-1.3 and the errors are gone now.

thomas_rendleman’s picture

Not just Ubercart.
Just installed Multiselect Module.
Getting this same error.

rileg’s picture

Also confirming fix in commerce 7.x-1.3

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