Seeing this error: Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in db_escape_string() (line 410 of /includes/database.mysqli.inc). I did see this issue http://drupal.org/node/268891 and implemented the patch but still saw this error. What's happening is that if a url is empty and it's not required, _link_process() is serializing attributes that don't exist, then appending it to the link item. Patch will be uploaded in the comment below. I tested the patch locally and it gets rid of the message.

CommentFileSizeAuthor
#1 empty-link-1580370-1.patch1.33 KBdjbobbydrake

Comments

djbobbydrake’s picture

Status: Active » Needs review
StatusFileSize
new1.33 KB

Patch attached. What I've done is move up the bit that unsets the url, which will happen for blank urls and invalid ones. Then I add a return if the url has been unset, because then there's no reason to add attributes to the link, which was causing the issue.

danielapsmaior’s picture

Title: mysqli_real_escape_string() expects parameter 2 to be string, array given in db_escape_string() » mysqli_real_escape_string() expects parameter 2 to be string, array given
Version: 6.x-2.9 » 6.x-2.11
Issue summary: View changes
Status: Needs review » Active

I'm getting this error in 6.x-2.11 version with drupal 6.31.
I have tried this patch in #1 and still didn't work.

warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /var/www/drupal-6.31/includes/database.mysqli.inc on line 329.

damienmckenna’s picture

Status: Active » Closed (won't fix)

Thank you all for your efforts, but I'm sorry to say that the D6 version is no longer supported.