I'm using postgresql 8.0.3, and when an authenticated user (without administer nodes permission) tries to post an article or add something to his blog, I get the following error:
warning: pg_query(): Query failed: ERROR: invalid input syntax for integer: "" in /includes/database.pgsql.inc on line 45.
user error:
query: INSERT INTO node (title, body, format, uid, type, teaser, status, moderate, promote, sticky, comment, created, changed, nid) VALUES('Test', 'Test', '1', '4', 'blog', 'Test', '1', '', '1', '', '2', '1122496961', '1122496961', '16') in /includes/database.pgsql.inc on line 62.
The problem is the '' in the VALUES part of the query. I checked the table, and that field has a default of 0, so I modified the modules/node.module:426 file and changed:
$v[] = empty($value) ? '0' : $value;
With this modification it works now, but I dont know if it has any sideeffect, Can you tell me if it's right or if it needs a better solution ?
Comments
Comment #1
poltawski commentedFurther to this, the same bug occurs when updating a node, so applied to same change to line 448, where the edit values have same problem.
This is a rather ugly hack & I notice this bug report: http://drupal.org/node/17656 which seems to cover similar issues.
I don't have the knowledge of the drupal architecture to know where this should be fixed properly? Seems like a problem which is not exposed in mysql.
Comment #2
Cvbge commentedMarking as duplicate of http://drupal.org/node/28996