Please see http://drupal.org/node/268891#comment-3383660 for reproduction scenario. This relates to "parameter 1" warnings such as:

warning: mysql_real_escape_string() expects parameter 1 to be string, array given in includes/database.mysql.inc on line 321.

I added some notes in: http://drupal.org/node/268891#comment-3514936

Is the solution indeed to replace the content_update call with one to node_save? It does appear as if calling content_update directly is not resulting in all of the preparation that is needed being done (i.e., serializing some arrays that need to be stored as strings).

Thank you!

CommentFileSizeAuthor
#12 cnr-928042.patch477 bytesjonskulski
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Same issue here!

domidc’s picture

Status: Active » Postponed (maintainer needs more info)

I believe the error is related to other fields than the nodereference instance. It will probably be caused by module not using the content api properly. Which other modules do you have enabled?

sachbearbeiter’s picture

i get this - and i have no overview at this point ...

* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in database.mysql.inc on line 321.

* warning: Invalid argument supplied for foreach() in corresponding_node_references.crud.inc on line 107.

* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in database.mysql.inc on line 321.

domidc’s picture

Still using version 6.3.3? This issue might be fixed in 6.4.1. Can you confirm?

sachbearbeiter’s picture

i did a fresh install -> but there is still the message

warning: mysql_real_escape_string() expects parameter 1 to be string, array given in database.mysql.inc on line 321.

but i had the following situation:

added in the 6.3.3 4 references to a node.
the editor changed later 3 of them to "unpublished" with vbo
testing the new install i wanted to save the node, but it was not allowed anymore (CNR?)
i deleted the 3 references and was able to save -> after this i got the message 3 times ...

coincidence?

i don't know if this explanation helps you -> but i keep tabs on it ...

domidc’s picture

A yes. When using the new version of cnr the allowed amount of references is handled by cck. This means you have to set the allowed amount of references on the cck node ref instance. Settings to unlimited like before is not needed anymore.
Enable your error reporting and you ll see that when you try to overload a node with more allowed reference you get a warning. Perhaps I should make this a warning in stead of an error?
I cant reporduce the other error. I ll try tonight with vbo installed. Perhaps there goes something wrong there?

domidc’s picture

Forget to ask. Can you confirm that overloading was the problem why you couldnt save your nodes?
Does the functionality fail because of the database error? Is everything still working?

domidc’s picture

Maybe this is causing the problem http://drupal.org/node/268891#comment-3383660

domidc’s picture

This one #978814: warning: mysqli_real_escape_string() expects parameter 2 to be string, array given ... database.mysqli.inc on line 323 is marked as a duplicate but may contain some useful info on this issue. Please continue to post in this issue.

tiyberius’s picture

Has there been any progress on this? Are people just not using the Link module in combination with CNR? What are some other options?

czigor’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

It very much seems to me that this is either a Link or CCK issue. Marking this as duplicate of #268891: mysqli_real_escape_string() expects parameter 2 to be string, array given in /includes/database.mysqli.inc on line 323. Please continue to post there.

jonskulski’s picture

FileSize
477 bytes

@tiyberius

Either use the patch I'll attach or see #268891 for a patch to link.module

@czigor

CNR does cause this error by invoking content_update() directly. Other modules can do it too (which is why I suggested to link.module that they use a fix someone provided), so the issue is larger than just CNR.

However, invoking content_update() is questionable imo. Do you have a reason to use content_update() directly? Do you know if this is something that cck had in mind?

Attaching a patch that uses node_save() instead. Let me know what you think.

All this being said, I posted in the thread #268891 suggesting that they make sure the proper _link_process() function is called. (This is the function that serializes the array so it can be saved).

Thanks!

jonskulski’s picture

Status: Closed (duplicate) » Needs review

oops, forgot to reopen.