Download & Extend

retroactive update causing mysql errors saving other cck fields

Project:File (Field) Paths
Version:7.x-1.0-beta3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

in filefield_paths.module, when it is trying to do retroactive updates, the line
_content_field_invoke_default('update', $node);
is resulting in bad queries trying to save fields defined by other modules:

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

in my case, it was a Link field. the problem is that the data in $node is not ready for an update, and content_storage('update',$node) (which is what that invoke boils down to) assumes that it is. here, the link attributes were still an array and hadn't been serialized.

the problem is, i am not sure how to fix that without re-breaking #494830: Remove Image Deletes the File Regardless of Other References. i tried boosting the weight of Filefield Paths to 50 and that didn't stop the error. adding another invoke default call for presave:
_content_field_invoke_default('presave', $node);
didn't work either. changing that to
content_presave($node);
so far seems to have done it, but that is pretty specific to Link and i really have no idea what the side-effects of that might be.

i don't know if you will consider this a bug in Filefield Paths or not, but i wanted to add a report in case other people are hitting a similar problem.

Comments

#1

I'm experiencing the same issue. The retroactive updates still seem to be working though... does this break any real functionality, or just cause the error messages to show?

#2

+1

[edit]
I am experiencing the same issue too on content types that have a link cck field.
[/edit]

#3

Confirmed. Seems to be a problem with link.module.

#4

Same problem here, and content_presave does seem to fix it.

#5

Status:active» needs review

Here's a patch for this. It's a one liner but I wanted to change the issue status.

I have been running in prod for this for more than 6 months. Patched against the 6.x-1.x git tree as of the time of this post.

AttachmentSize
940156-5.patch 487 bytes

#6

Version:6.x-1.x-dev» 7.x-1.0-beta3

I'm having a similar problem on D7 with filelfield_paths 7.x-1.0-beta3 – is there a patch for that as well? I've found a few similar issues in the queue, but none are quite the same or have a solution I've been able to work with. Anyone have any ideas here? Screenshot attached.

AttachmentSize
Screen shot 2012-08-13 at 5.02.12 PM.png 61.06 KB

#7

Status:needs review» postponed (maintainer needs more info)

I'm going to need some more information on how to reproduce this issue, such as the setup of the content type that 100% introduces this issue.

The screenshot of the error is too generic to do anything with.

nobody click here