Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Jan 2008 at 00:53 UTC
Updated:
29 Jan 2008 at 11:12 UTC
the $placeholders variable isn't declared, and is only set within a conditional. when the $object arg of drupal_write_record() is an empty object, $placeholders never gets set, resulting in an error when implode($placeholders) is called (common.inc, line 3288).
| Comment | File | Size | Author |
|---|---|---|---|
| common-drupal_write_record.patch | 630 bytes | becw |
Comments
Comment #1
bdragon commentedAdditional info:
The situation where this happens is a table with a single serial column.
We encountered this when porting a module from 5 (there had previously been a db_next_id() call to create a new thread id if it was nonexistent, we switched this to inserting rows in a table, but didn't have any additional columns to add at the time.
Comment #2
dropcube commentedExactly, tested trying to insert an object with only one serial field and there are no placeholders in the query. It is easy to see in the code and the patch is simple, so for me it's RTBC.
Comment #3
gábor hojtsyCommitted, thanks.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.