I'm getting this error when trying to add a new TEXT field:

user warning: Field 'description' doesn't have a default value query: drupal_write_record /* drupal : drupal_write_record */ INSERT INTO content_node_field_instance (field_name, type_name, weight, label, widget_type, widget_settings, display_settings, widget_module) VALUES ('field_test_string', 'test_hidden', 0, 'field_test_string', 'text_textfield', 'a:1:{s:4:\"rows\";s:0:\"\";}', 'a:5:{s:5:\"label\";a:1:{s:6:\"format\";s:5:\"above\";}s:6:\"teaser\";a:1:{s:6:\"format\";s:7:\"default\";}s:4:\"full\";a:1:{s:6:\"format\";s:7:\"default\";}i:0;a:1:{s:6:\"format\";s:5:\"above\";}i:1;a:1:{s:6:\"format\";s:7:\"default\";}}', 'text') in D:\net\BlackTea_6.0\includes\common.inc on line 3295.

This is happening when I click the submit button on the "Create New Form" form.

My guess would be that this is coming from content_crud.inc:386, where the $field variable doesn't have a 'description' defined. According to the schema, the description field cannot be NULL and has no DEFAULT defined.

CommentFileSizeAuthor
#1 206420.patch1 KBasimmonds

Comments

asimmonds’s picture

Status: Active » Needs review
StatusFileSize
new1 KB

Attached is a small change I did to content_field_instance_collapse() that appears to fix this error, and allow me to create a field properly.
Running php 5.2.5 / mysql 5.0.45 (with strict mode enabled)

corsix’s picture

Patch works for me, thanks.

yched’s picture

http://drupal.org/node/214406 was marked duplicate (reported the same behavior with PgSQL)
The patch over there fixed it by altering the 'description' column to accept NULL.

I'm actually not sure why this column was set to NOT NULL to begin with, it's probably been the case from the early days.

I went for the minimal change for now, and committed the patch above (and also altered surrounding lines to always provide an empty string instead of NULL for a few other field elements)

yched’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.