For seemingly no reason whatsoever, I am getting this error message whenever I try to create a new block. Thought it might be the LoginTobagan module I just added, but that is not it, since I removed it completely and am still getting this message. Any help would be greatly appreciated. No idea how to fix this.

PDOException: SQLSTATE[HY000]: General error: 1364 Field 'bid' doesn't have a default value: INSERT INTO {block_custom} (body, info, format) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => Test. [:db_insert_placeholder_1] => Test Block [:db_insert_placeholder_2] => filtered_html ) in block_add_block_form_submit() (line 560 of /home1/htalwala/colorscopy.com/modules/block/block.admin.inc).

Comments

flaviovs’s picture

Assigned: htalwala » Unassigned
Status: Active » Postponed (maintainer needs more info)
Issue tags: -Block PDO Exception Error

Column bid should be auto increment. So, there should not be any problem running the SQL you posted. This is from a D7 MySQL database:

mysql> desc block_custom;
+--------+------------------+------+-----+---------+----------------+
| Field  | Type             | Null | Key | Default | Extra          |
+--------+------------------+------+-----+---------+----------------+
| bid    | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| body   | longtext         | YES  |     | NULL    |                |
| info   | varchar(128)     | NO   | UNI |         |                |
| format | varchar(255)     | YES  |     | NULL    |                |
+--------+------------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

What is your database driver?

Can you please post a schema view of your block_custom table?

cilefen’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

There was not a reply from the original reporter in one year.