bug - 2.0.12 - ProductsBlock - Products

I’m running the stock cart with the demo data and testing things in it out.



I attempted to do a Related Products and added a block for that in the Products Block.



BlockContent: Products (not hiding buy button)

Filling: Manually

Appearance Type: Products (show item number)

no wrapper



On each item added that’s listed on the page I get this error:

Warning: strpos() expects parameter 1 to be string, array given in C:\xampp\htdocs\cscart\core\templater_plugins\modifier.escape.php on line 24



Below ‘In Stock’ and above the description.

You likely will not get many responses posting in the Labs section of the forum - this area is meant to provide an opportunity to comment on the current development version of CS-Cart:

[url]Ecommerce Solutions and Software for all types of business - CS-Cart



I have not been able to duplicate this issue. Can you duplicate it on the demo site (demo.cs-cart.com)?



Bob

I tried to try it on the demo, but it doesn’t have the Appearance: Products option.

Is it a different version? If display_errors isn’t enabled it won’t show it and everything will work fine since it’s only a warning.



I’m running a default install on windowsXP, xampp 1.7.3

The Appearance: Products is only available when the position is central. I just tried the demo store an can confirm it is there but the demo store is locked down so that you cannot add a block.



I don’t receive the error running 2.0.12 on a Linux server. Unfortunately, I do get inconsistent results - sometimes the block displays, other times it does not.



Bob

I’m guessing it’s something with my install, because it shows the warning everywhere the product is listed. I didn’t notice it before. I’ll reinstall the entire cart and see if it’s still there. I can’t imaging that would have gone unnoticed otherwise.

I just did a fresh install, clean, new db, just extracted from zip, and right out of the box the issue is there… on every page. That is a serious problem.

I’ve been tracing down the problem.



I found \customer\common_templates\product_data.tpl line 85:

{include file="views/products/components/product_features_short_list.tpl" features=$product.product_id|fn_get_product_features_list|escape no_container=true}



Specifically this: $product.product_id|fn_get_product_features_list|escape



The product id is sent to the function fn_get_product_features_list in core\fn.catalog.php



That function returns an array of all the product features. That array is then sent to escape, which expects a string, not an array. So it shouldn’t be escaped at all, or should be done a different way.



I’m not even sure the purpose of that line, it prints the product mfg in front of the description like on this page:

[url]Instant Demo - CS-Cart Multi-Vendor Demo Try Free for 15 days





I don’t see why the issue would be windows specific. Perhaps everyone is running with warnings off? That’s fine and all, but it is still a problem and bad code.





I’m using the basic skin.

Please refer to the [url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=1609[/url]

There is a fix for your issue.