Seen on all V8 and V9.
Spurious and unreliable PHP code execution within Product Lists. Problem seems to be dependent on a combination of number of items in the list and the spacing / line breaks used in the code.
Scenario:
We're trying to add some code to display the number of products in a Section.
The following code is added to a Section Link layout:
Results are as expected unless the Section contains exactly 1 product. In this case Product count: 2 is displayed.
Changing the code so that there are no line breaks or spacing between the product list block and the PHP block seems to fix this. E.g.
Spurious and unreliable PHP code execution within Product Lists. Problem seems to be dependent on a combination of number of items in the list and the spacing / line breaks used in the code.
Scenario:
We're trying to add some code to display the number of products in a Section.
The following code is added to a Section Link layout:
Code:
<actinic:block php="true">$productsonpage=0;</actinic:block> <actinic:block type="ProductList"> <actinic:block php="true"> $productsonpage++; </actinic:block> </actinic:block> <actinic:block php="true">echo "Product count: $productsonpage";</actinic:block>
Changing the code so that there are no line breaks or spacing between the product list block and the PHP block seems to fix this. E.g.
Code:
<actinic:block php="true">$productsonpage=0;</actinic:block> <actinic:block type="ProductList"><actinic:block php="true"> $productsonpage++; </actinic:block></actinic:block> <actinic:block php="true">echo "Product count: $productsonpage";</actinic:block>
Comment