Partial data retrieved but with error mysqli_real_escape_string() expects parameter 2 to be string, array is SOME products
charos - March 6, 2009 - 01:16
| Project: | Amazon Module |
| Version: | 6.x-1.0-beta7 |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | critical |
| Assigned: | rfay |
| Status: | active |
| Issue tags: | 6.x-1.0 blocker |
Description
This is the warning on Test
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in .../includes/database.mysqli.inc on line 323.
It retrieves some data but surely not all arrays. Latest beta5 version. In the node I bypass the error with making it hidden in the display field as suggested but the test shows the error anyhow and not everything is retrieved. Ideas?

#1
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in .../includes/database.mysqli.inc on line 323. This happens with e.g. this ASIN: B000A2GYEO
But with this ASIN: 0805444777 no error is shown. Ideas?
#2
subscribing
#3
likewise subscribing...
using example ASIN as in #1 I get the following returned
Array
(
[asin] => B000A2GYEO
[salesrank] => 261899
[detailpageurl] => http://www.amazon.co.uk/See-Sound-Etro-Anime/dp/B000A2GYEO%3FSubscriptio... [listpriceamount] => 1999
[listpricecurrencycode] => GBP
[listpriceformattedprice] => £19.99
[binding] => Audio CD
[ean] => 0754863202322
[format] => Import
[label] => Neurodisc
[manufacturer] => Neurodisc
[numberofdiscs] => 1
[originalreleasedate] => 2004-02-24
[productgroup] => Music
[producttypename] => ABIS_MUSIC
[publisher] => Neurodisc
[releasedate] => 2004-02-24
[studio] => Neurodisc
[title] => See the Sound
[upc] => 754863202322
[artist] => Array
(
[0] => Etro Anime
)
[participants] => Array
(
[0] => Etro Anime
)
[imagesets] => Array
(
[smallimage] => Array
(
[url] => http://ecx.images-amazon.com/images/I/21G-RqCxS1L._SL75_.jpg
[height] => 75
[width] => 75
)
[mediumimage] => Array
(
[url] => http://ecx.images-amazon.com/images/I/21G-RqCxS1L._SL160_.jpg
[height] => 160
[width] => 160
)
[largeimage] => Array
(
[url] => http://ecx.images-amazon.com/images/I/21G-RqCxS1L.jpg
[height] => 216
[width] => 216
)
)
)
#4
I think I've narrowed this problem down to music CD's.
If I test against books, laptops, power drills, games, or even MP3 downloads all is fine.
Everytime I test against a CD I get a couple of errors (see attached). These show up twice per node everytime I run CRON which isn't good considering the site is a music review site!
I'm comparing the arrays returned from different product types but I can't debug code so not sure what's causing the problem. Hopefully this message will prove useful to someone else in fixing the issue.
Cheers :)
#5
I am unable to recreate this in the current version (tonight's dev release). I tested by using this ASIN in an ASIN cck field, and also on the admin test page. Please re-check.
Thanks,
-Randy
#6
Hmm...
I still get it. I'm attaching a screendump so you can see what other modules I have installed / enabled / configured.
If you spot something I should add / delete / enable / disable I'd be happy to oblige.
Cheers :)
Mik
#7
I haven't had anybody tell me how to recreate this, so can't really pursue it. If you use the scenario I outlined in #5, do you get this error? When? How?
The way to resolve this, if you can demonstrate it on a test/dev install, is to add something like this to the line right before the offending line, includes/database.mysql.inc, line 323:
if (is_array($text)) {drupal_set_message("Got array instead of text. \$text==".print_r($text,TRUE));
drupal_set_message(print_r(debug_backtrace(),TRUE));
}
Please try that, and I think it will tell us all.
#8
I read this more carefully and now am able to recreate the issue, so will get it fixed. I hadn't understood that this only happens on the test page (admin/settings/amazon/test).
#9
#10
Being dim: having problems replying for some reason...
#11