Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/cyberfan/htdocs/includes/database.mysql.inc on line 321.
Comment | File | Size | Author |
---|---|---|---|
#24 | feed_settings.png | 13.56 KB | Danny_Joris |
#24 | flickr_xml.png | 73.19 KB | Danny_Joris |
#5 | err.txt.zip | 172.78 KB | bleen |
Comments
Comment #1
IKN CreditAttribution: IKN commentedSame here. Update from alpha to beta5 broke site -- had to roll back.
Comment #2
alex_b CreditAttribution: alex_b commentedNeeds more info:
- where exactly does this error occur?
- after which actions?
Comment #3
alex_b CreditAttribution: alex_b commentedComment #4
AntiNSA CreditAttribution: AntiNSA commentedI have completely deleted my old feeds directory uploaded a fresh version of this beta and things cleared up... not sure if it was cash clearing or what..?
Comment #5
bleen CreditAttribution: bleen commentedsame problem as original post ...
I'm using D6.19.
Updated to beta5 (from beta4) using drush. Download runs successfully, dbupdate runs fine ... then the next time i do a cache clear I get:
I get this error consistently on
drush cc all
... but i see it sporadically when navigating the site. No pattern that I can discern... I have rolled back my dev site twice and everything gets cleared up. Then when I update feeds I get this error again, so I'm confident that it's the update that is casing this particular issue.Attached is the backtrace from these errors so (hopefully) you can see what is going on... I might be wrong here, but I suspect that the issue might be in the function feeds_menu() because the source of the error *seems* to be that you're passing in an array for "description" without serializing it. In the excerpt below, check out arg[17]:
Comment #6
georgedamonkey CreditAttribution: georgedamonkey commentedSame here. Copied directory over, ran update.php, and I now get that error.
Comment #7
bleen CreditAttribution: bleen commentedi tried this update again on second site and still had the same issue ...
I did a bit more digging and I have a bit more info, but nothing too useful. Basically, I can now confirm that these errors are specifically happening when the menu cache is cleared.
Any more thoughts on this? Anyone?
Comment #8
alex_b CreditAttribution: alex_b commentedWhat's really baffling is that array that contains an array with two equal strings "This content type is being used for automatically aggregated content from feeds." where it should contain a single string of that value. Reviewing feeds_news_node_info() I see that the string is not specified as array though.
I don't really have an idea right now why this happens, but I have seen this error before. Thanks for digging up the debug backtrace.
Comment #9
Marko B CreditAttribution: Marko B commentedwarning: mysqli_real_escape_string() expects parameter 2 to be string, array given in mysite\includes\database.mysqli.inc on line 323.
having same problem, happens when i hit FLUSH all cache.
Comment #10
Jon Nunan CreditAttribution: Jon Nunan commentedHaving a look around the code feeds_news and feeds_defaults both use hook_node_info and they both define the same node types; 'feed' & 'feed_item'. It seems that because module_invoke_all uses array_merge_recursive you get some fields added twice which in turn get converted to arrays.
I'm testing out adding a check to feed_news_node_info to see if feeds_default is enabled. If it is, it won't re-define the same nodes. eg.
Comment #11
alex_b CreditAttribution: alex_b commentedYou shouldn't have a feeds_defaults module in your feeds/ tree. Have you cleanly replaced feeds when upgrading or unpacked feeds over the existing directory?
Comment #12
Marko B CreditAttribution: Marko B commentedI also had some much more problems with feeds until i deleted feeeds directory and put new one, in most cases you can overwrite but sometimes it makes thinks not work.
Comment #13
alex_b CreditAttribution: alex_b commentedNo module will have a provision for an old file sticking around. Always remove the previous project directory and replace it with a fresh one, never unpack over an existing.
Comment #14
Jon Nunan CreditAttribution: Jon Nunan commented@alex_b: ah that'd be it. Sorry, got a bit lazy. I usually do delete/replace, but cut some corners because I was just upgrading from an earlier beta.
Thanks!
Comment #15
Marko B CreditAttribution: Marko B commentedAlex i ment it will work im most cases as it does but i dont recommend such practice :-)
Comment #16
alex_b CreditAttribution: alex_b commented#14: Cool - I'll regard this issue as fixed now.
Comment #17
hampshire CreditAttribution: hampshire commentedwarning: mysqli_real_escape_string() expects parameter 2 to be string, array given in .../includes/database.mysqli.inc on line 323.
I have this problem as well but I am on a fresh install so no upgrades yet. I get this error when I hit "Import" and only when GUID is set in my XPath mapper. IF I remove the xpathparser -> GUID I nolonger get the error.
Comment #18
hampshire CreditAttribution: hampshire commentedComment #19
iantresman CreditAttribution: iantresman commentedI removed and uninstalled my old Feeds 6.x-1.0 beta 5 (on Drupal 6.16), and then installed the latest beta 9. On enabling Feeds News 6.x-1.0-beta9, the top of the modules admin screen shows (seven times!):
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /home/www.mydomain.com/public_html/includes/database.mysqli.inc on line 323.
Comment #20
Danny_Joris CreditAttribution: Danny_Joris commentedSame issue. I also had an xmlsitemap error, but now I disabled that there's only this error left:
I'm trying to import from a Flickr api xml feed. I'm using the Feeds XPath parser for this.
I'm using these queries to get the id and title attribute values from the 'photo' tag: photo/@id and photo/@title
Comment #21
Danny_Joris CreditAttribution: Danny_Joris commentedIt results in making only one node without a title. The only filled out is the Flickr ID.
Comment #22
alex_b CreditAttribution: alex_b commentedLooks like an XPath parser problem to me...
Comment #23
twistor CreditAttribution: twistor commented@Danny_Joris
Could you post your context and a sample of the xml?
Also, this problem shows up sometime when the query returns multiple values for a field expecting a single value. If you could, try changing your queries to, "photo/@id[1]", "photo/@title[1]" and see if that helps.
Comment #24
Danny_Joris CreditAttribution: Danny_Joris commented@Chris
Feed settings and sample of the xml in attachment.
I also tried adding [1], but that didn't work.
Comment #25
twistor CreditAttribution: twistor commentedAre you still having this problem? Sorry for the long time between responses.
Comment #26
squinternata CreditAttribution: squinternata commentedI have the same problem with dev i have a simple xml and i m importing in nodes but it doesn t fill the title and the body..only a text field..
the xml is
<?xml version="1.0" encoding="ISO-8859-1"?>
29.99Harry Potter
39.95Learning XML
in the feed i put
in Context: *
//book
in field_test:
//title
in title:
//title
in body:
//price
and i get two nodes but both wiht only the field_text filled with the first title in book
could you help me please?
Comment #27
squinternata CreditAttribution: squinternata commentedsorry i get also this error
in import
* warning: mb_strlen() expects parameter 1 to be string, array given in /opt/lampp/htdocs/TestDrupal/includes/unicode.inc on line 410.
* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /opt/lampp/htdocs/TestDrupal/includes/database.mysql.inc on line 321.
* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /opt/lampp/htdocs/TestDrupal/includes/database.mysql.inc on line 321.
* warning: mb_strlen() expects parameter 1 to be string, array given in /opt/lampp/htdocs/TestDrupal/includes/unicode.inc on line 410.
* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /opt/lampp/htdocs/TestDrupal/includes/database.mysql.inc on line 321.
* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /opt/lampp/htdocs/TestDrupal/includes/database.mysql.inc on line 321.
Comment #28
joris_luciusI also had the problem with
I disabled all these modules, cleared cache and disabled-> enabled feeds modules.
After that, I got this error no more:
+ Context
+ Features
+ Pathauto
+ Statistics
+ All FeedAPI modules
EDIT:
When tried to map the title field, I got the error back.
And got the problem: only one node is created, without a title.
One field in this one node is mapped and thus filled.
While in my debug-message, I can see all field scraped ok.
I'm using the XPath HTML parserr,
The XPath XML parser works fine on another system.
in addition, when switching on 'show error messages' i got:
Feeds 6.x-1.0-beta10
Comment #29
twistor CreditAttribution: twistor commentedCan I have your XML/HTML that you're trying to parse, the XPath queries and context, and the fields you're mapping to? Thanks.
Comment #30
timoguic CreditAttribution: timoguic commentedHi,
I have the same problem on my installation.
Feeds 6.x-1.0-beta10
Feeds XPath Parser 6.x-1.11 (using Xpath HTML in this case)
HTML looks like this:
Show debug says:
The body of the created node is empty, however I can see that the Xpath expressions are run correctly (in the show debug) - although the Xpath expression for the body returns several elements (as expected).
When I change the expression so that it only returns one element (for instance: //div[@class='intro']) everything works fine. I tried to flush the caches, uninstall Feeds and Feeds Xpath and reinstall etc, without any luck - so I am tempted to think it's related to this issue.
Any ideas?
Comment #31
Marko B CreditAttribution: Marko B commented@timoguic Can you post link you are trying to parse? I am also having some similar problems here.+
http://drupal.org/node/1044546
Comment #32
timoguic CreditAttribution: timoguic commented@deepM: http://bit.ly/hEtb1K
I have to try again on a fresh Drupal install - did not have time to make tests since my last post...
Comment #33
crizcan't get this module working after upgrade too, getting exactly the same errors. xpaths are working...
Comment #34
Jason Dean CreditAttribution: Jason Dean commentedI'm getting the same thing, using clean install of Feeds 6.x-1.0-beta10 and Feeds XPath Parser 6.x-1.11
My XML:
Context: //Show
title field mapping: //@Name[1]
Import creates 2 nodes but they don't have titles. The debug output looks fine, but it's followed by this error repeated 4 times:
warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/jason/webdev/drupal6/includes/database.mysql.inc on line 330.
Interestingly, I don't get any "There was an error with the XPath query..." message as mentioned by others.
Comment #35
Jason Dean CreditAttribution: Jason Dean commentedSorry - I was being stupid.
The parser was trying to force an array (containing both Show titles) into the title field, and of course Drupal didn't like that. But this was because my XPath expressions were all wrong. They should be:
context: //Show
title field: @Name
Now working fine :)
Comment #36
JGReidy CreditAttribution: JGReidy commentedFor what it's worth I was having the same problem after update to Feeds 6.x-1.0-beta10, but I was using the Common syndication parser, not XPath Parser.
I copied down my feed and mapping info, disabled and uninstalled Feeds, re-enabled it, recreated my feed and the problem went away.
Comment #37
twistor CreditAttribution: twistor commentedThis problem seems to show up when the query returns multiple values for a field expecting a single value. This issue is getting a bit crowded. If anyone is still having this problem, please open another issue.