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

charos - March 6, 2009 - 01:23
Title:Partial data retrieved but with error mysqli_real_escape_string() expects parameter 2 to be string, array» Partial data retrieved but with error mysqli_real_escape_string() expects parameter 2 to be string, array is SOME products

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

FrontBurner - March 21, 2009 - 19:19

subscribing

#3

mikf - July 28, 2009 - 18:43
Version:6.x-1.0-beta5» 6.x-1.0-beta7

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

mikf - July 29, 2009 - 18:51

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 :)

AttachmentSize
Amazon API - 1.png 44.78 KB
Amazon API - 2.png 50.28 KB
Amazon API - 3.png 50.13 KB

#5

rfay - October 4, 2009 - 20:50
Status:active» postponed (maintainer needs more info)

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

mikf - October 27, 2009 - 13:48

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

AttachmentSize
Modules-dev.arcticreviews.co_.uk_1256651246697.png 347.16 KB

#7

rfay - October 27, 2009 - 14:21

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

rfay - October 27, 2009 - 18:47
Status:postponed (maintainer needs more info)» active

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

mikf - October 27, 2009 - 18:36

#10

mikf - October 27, 2009 - 18:44

Being dim: having problems replying for some reason...

#11

rfay - December 5, 2009 - 01:31
Assigned to:Anonymous» rfay
Issue tags:+6.x-1.0 blocker
 
 

Drupal is a registered trademark of Dries Buytaert.