I have tested this on one server with 7.x-1.1 and another with 7.x-1.1 as well as 7.x-1.x-dev.

1. Use the Commerce Custom Line Items (Types) module to create a custom line item type or creates a custom line item type via custom module.

2. Visit a content type's manage display form which has a product reference field attached. The product reference field's format should be set to Add to Cart form.

Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1552 of /Users/sreeves/WebServer/commerce_kickstart/includes/bootstrap.inc). displayed via drupal_set_message.

From my small amount of digging, it looks like the issue is commerce_cart_field_formatter_settings_summary() is assuming commerce_line_item_type_get_name() always returns a string. It returns either a string or an array. When no value is set for line item type, commerce_line_item_type_get_name() will return an associative array, which throws off check_plain.

Comments

rszrama’s picture

Project: Commerce Core » Commerce Custom Line Items (Types)
Component: Cart » Code
Status: Active » Fixed

Yes, don't use that module. Use Commerce Customizable Products instead: http://drupal.org/project/commerce_custom_product

star-szr’s picture

Status: Fixed » Active

I don't think the fault is with the Commerce Custom Line Items (Types) module at all. The same behaviour occurs with the line_item_example module from commerce_examples, as well as Commerce Customizable Products.

star-szr’s picture

Project: Commerce Custom Line Items (Types) » Commerce Core
Component: Code » Cart
rszrama’s picture

Project: Commerce Core » Commerce Custom Line Items (Types)
Component: Cart » Code

Hmm, I'll look into whether the fault is with this module or not, but even so you should still be using the other module for UI based product line item type creation.

star-szr’s picture

I'll try to boil down the exact steps to reproduce from a fresh commerce kickstart install.

star-szr’s picture

Status: Active » Closed (cannot reproduce)

Okay, couldn't reproduce this from a fresh install so I'm thinking something is wonky on my real installs. My apologies.

star-szr’s picture

Issue summary: View changes

Adding note about check_plain

a.milkovsky’s picture

I can suggest you missed line_item settings in "Add to cart" form formatter