I have a content type where I have added a cck field (image type). When I initially add images to this node, it works fine. However, if I edit it, and then submit it (even if I do nothing), then I get this error.

I poured out the sql statement to the log, and here is how it showed up

	SELECT count() FROM {content_field_image_cache} WHERE = 48

It only happens for the images that were in the file PRIOR to the edit. Any new images seem to work just fine.

Any thoughts where I should look. I am a novice PHP programmer, so can understand lots of the code, but I just don't have a clue why it is doing it. If you nudge me, I might be able to figure it out...

Comments

carsonh’s picture

Same on my page, below the full message:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') FROM live_content_field_image_cache WHERE = 142' at line 1 query: SELECT count() FROM live_content_field_image_cache WHERE = 142 in /path/to/website/sites/all/modules/filefield/filefield.module on line 898.
mcurry’s picture

subscribe

quicksketch’s picture

Project: FileField » Ubercart
Version: 6.x-3.1 » 6.x-2.2

Sounds like a problem with the field that Ubercart sets up upon installation to me (the "field_image_cache" field). If you can create a new content type and add a FileField to it that has this same problem, move back over to FileField. Most likely you need to update your Ubercart or try reinstalling it.

AlexisWilke’s picture

The actual error is generated by this statement. This the content_database_info($field) call fails...

    $db_info = content_database_info($field);
    $references += db_result(db_query(
      'SELECT count('. $db_info['columns']['fid']['column'] .')
        FROM {'. $db_info['table'] .'}
        WHERE '. $db_info['columns']['fid']['column'] .' = %d', $file->fid
    ));
longwave’s picture

Status: Active » Closed (cannot reproduce)

Doesn't seem to be an Ubercart issue, if this still occurs with latest Filefield and Ubercart please reopen.