Hi,

I am getting the warning message "warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in .../includes/database.mysqli.inc on line 323." as soon as I add a node which has a reference to another node.

I am aware of this discussion/issue http://drupal.org/node/928042 (quite similar), but as this one here refers to "parameter 2" and the latest version of CNR I hope it is ok that I opened a new issue.

I am using quite some modules, but I could nail it down to the following:

I have content types "PROJECT", "EVENT". Each of them could have 0-unlimited references to the other type and vice versa. When I create an event "Todays event" and link it to "My Project", I want to have a reference/link under "My Project" which is automatically set and points at "Todays event". That's why I am using CNR and although I am getting the warning messages it seems to work just fine :-)

VERSION INFO:
Drupal 6.19
CNR 4.1
.. some 20 other modules

STEPS TO REPRODUCE:
1.) configure a CCK field in content type "project" to have unlimited node references to content type "event"
2.) do the same for "event", unlimited node references to content type "project"
3.) activate at "/admin/settings/corresponding_node_references" the corresponding fields "events and projects"
4.) fill in some events
5.) add a project and link it to an event
6.) when saving the node I receive the error message "warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /public_html/includes/database.mysqli.inc on line 323." Still the backlink is successfully set at the corresponding event node.
7.) when re-editing this project node by removing the link to the event and saving the project, I am getting the same warning message. Still the backlink is successfully removed at the corresponding event node.

WHY COULD CNR BE RESPONSIBLE FOR THAT?
- When not adding any reference I can edit the node multiple times and never received an error message.
- When I deactivate the corresponding fields that I set in step 3., everything (steps 5.-7.) works just fine without any error. Well, of course the backlink is not set.

CLEARLY REPRODUCIBLE?
Not really. It seems like content that has been added with an earlier version of Drupal and CNR seems to be affected more rarely.
Yet, as soon as I will get a warning message, I will get it always as long as the corresponding node reference is active.

Thank you very much for your help and please let me know in case you need any further details!

Holger

Comments

adshill’s picture

Getting the same error here - however not as admin (user:1) - only as other users adding/editing nodes which could be some useful information. I'm sure its CNR related because in one content type I have 1 CNR and another I have 3, on the content type with 3 we get the error 3 times, the one with 1 we get it once!

Ooof... hope that made sense. Anyway info above from apfelkraut is pretty detailed - just confirming we get it here too. Seems everything works, but error is not going down well with the client. Will see what we can find but any pointers or help in debugging well received!

Adam

apfelkraut.org’s picture

Component: Miscellaneous » Code

Hi,

without a broad knowledge of drupal and php, I did some further checking on my installation and it seems that this discussion over at the link module seems to be strongly related to the issue I tried to describe: http://drupal.org/node/268891#comment-3383660. Although this discussion already started back in 2008, make sure to check also the comments of 2010.

As soon as deactivate the module Link - with the CNR module still active - everything is working just fine.

Regards,

Holger

domidc’s picture

Status: Active » Closed (duplicate)