integer-net / Solr

Solr Module for Magento 1.
http://de.integernet-solr.com/
6 stars 0 forks source link

htmlspecialchars warning during Reindex #23

Closed avoelkl closed 8 years ago

avoelkl commented 8 years ago

Hi,

I recognized that we have several of these warnings in our log: Warning: htmlspecialchars() expects parameter 1 to be string, array given in /...../IntegerNet_Solr/src/lib/IntegerNet_Solr/Apache_Solr/Service.php on line 868

So it might happen that $multivalue is an array on this line here.

I just threw a quick debug in there to find out what a $multivalue can be and this resulted in:

array ( 0 => 'Eifrei', 1 => 'Erdnussfrei', 2 => 'Fischfrei', 3 => 'Gelatinefrei', 4 => 'Glutenfrei', 5 => 'Hefefrei', 6 => 'Nussfrei', 7 => 'Ohne Konservierung', 8 => 'Ohne Zuckeraustausch', 9 => 'Schalentierfrei', 10 => 'Vegetarisch', 11 => 'Weizenfrei', 12 => 'Zuckerfrei', ) 

As I'm not quite sure how the XML structure should look like, I did not fix it yet. Please have a look :)

avstudnitz commented 8 years ago

Sorry, can't reproduce that. I assume the attribute in question is a multiselect attribute which get indexed correctly in my test cases. Could you log the whole $document for the case where this is happening? Is it happendning for all products, or only few? Currently, I can't think of a case where '$value' is an array with more than one dimension.

avstudnitz commented 8 years ago

Fixed with aef33cdf89b6d4c0dbc87ee2a866b13b605907c3. it was a problem with multiselect attributes in configurable children. Thanks @avoelkl for your help!