When I add a field (numeric text field), I get an error :

user warning: Field 'display_settings' doesn't have a default value query: INSERT INTO node_field_instance (field_name, type_name, weight, label, widget_type, widget_settings, description) VALUES ('field_numro_de_voile', 'bateau', 0, 'field_numro_de_voile', '', '', '') in D:\InetPub\WWWRoot\drupal5\includes\database.mysql.inc on line 172.

This is the same problem as described in http://drupal.org/node/108094 . This is not fixed in version 1.5.

A workaround is to edit the node_field_instance table and allow NULL for display_settings column, but I don't know about side effects.

Comments

lias’s picture

I had the same error when trying to add image field to a cck node. I'd be interested in the side effects, if any, as well.

Thanks for the workaround.
Lsabug

yched’s picture

This is in fact not the same problem as in http://drupal.org/node/108094.
The fix for this should be simple, but right now I have to leave my keyboard :-(
More on this soon.

yched’s picture

I committed a fix to 5 and 4.7 branches.
Plus I added an update function to 5 branch to fix possibly corrupted db - not sure about the 4.7 version of this for now, I will see that tomorrow (I'm leaving this open until then)

yched’s picture

Status: Active » Fixed

I committed the update function for 4.7 (and updated the one already added to 5.0 and HEAD)

sfa’s picture

Im running Drupal 5 and im still having this problem, im quite new to drupal and Im not quite sure which file i need to download to fix this, could you point me in the right direction?

yched’s picture

CCK project page http://www.drupal.org/project/cck
click "view all releases" and download cck 5.x-1.x-dev
the direst clink is http://ftp.osuosl.org/pub/drupal/files/projects/cck-5.x-1.x-dev.tar.gz

liquidcms’s picture

Version: 5.x-1.3 » 5.x-1.x-dev
Status: Fixed » Active

sorry. changed this to active

i was getting this error:



    * user warning: Field 'display_settings' doesn't have a default value query: INSERT INTO node_field_instance (field_name, type_name, weight, label, widget_type, widget_settings, description) VALUES ('field_fghfgh', 'content_product_category', 0, 'fghfgh', 'text', 'a:0:{}', '') in C:\Inetpub\websites\rv\includes\database.mysql.inc on line 121.
    * user warning: Table 'l_rv.node_' doesn't exist query: ALTER TABLE node_ ADD COLUMN field_fghfgh_value longtext NOT NULL in C:\Inetpub\websites\rv\includes\database.mysql.inc on line 121.

when trying to do duplicate type or add field.

Then i saw this post and is sounded as though this has been fixed. I pulled down lastes cvs (Feb12) and error still persists.

I am using 4.7.5, MySQL 5.0.

I sounds like solution is in the table definition and the fix might be do do an update??? Although when i copy over latest cck module folder i do not get any updates being required.

liquidcms’s picture

and yes... modifying the table node_field_instance and setting display_settings field to Allow NULL fixes the problem.

yched’s picture

There's no way you can get those exact same errors with latest 1.x-dev code.
Please post the exact errors you're getting and the actions that trigger them.

The update function is not the fix in itself, but an attempt to repair potentially stale db tables due to the bug. It was added on Feb 5, so depending on whether your previous cck install was older than thatn, you should be proposed with the update when you execute update.php.

Sorry to ask, but are you _really_ sure you're running latest cvs ?

liquidcms’s picture

yup, sorry .. my bad.. i accidentally unzipped the folder to cck rather than to modules... so i actually had a modules/cck/cck.. and it was picking up the first one.

i now get an update to content update #10.. although i noticed when i ran this that the fix was not as mentioned above of setting display field to allow null.. so i will set that back and re-test.. but sure it is all fine now.

thanks,

yched’s picture

Status: Active » Fixed

Yes, the fix does _not_ alter the table definition, but ensures that a value is always provided.
Setting to fixed - reopen if not

liquidcms’s picture

Status: Fixed » Postponed (maintainer needs more info)

ok, sorry.. NO.. i don't think it is fixed.

I never actually tested after you pointed out i was likely using the wrong version. As i mentioned i un-archived to wrong location so i was likely picking up the wrong code. I fixed that; but problem does persist.

When i add a new node i get

user warning: Field 'field_detailed_description_value' doesn't have a default value query: INSERT INTO node_content_product (field_brief_description_value, vid, nid) VALUES ('sdf sd fsdf sdf ', 433, 433) in C:\Inetpub\websites\rv\includes\database.mysql.inc on line 121.

i am using: cck-4.7.x-1.x-dev.tar.gz dated Feb 11/07

The error gets generated ONLY when i first create the node; updates don't cause warning.

I have re-saved all the fields in the cck type as well as resaved the type def itself. This does not fix.

Possibly i missed the requirement - is it necessary for me to delete my CCK type and start from scratch?

Also, as before - setting the field that showed up in the error in the DB to Allow NULL again fixes the problem.

BTW - the field which case the problem is a required text field - not sure if that helps any.

yched’s picture

Status: Postponed (maintainer needs more info) » Fixed

not the same bug.
What you're experiencing now is specific to text.module with MySQL5 : http://drupal.org/node/108094.
Not good fix for that yet, unfortunately.

liquidcms’s picture

ok , thats what i thought ... i knew i had seen something about still an issue with text field.

so, silly question, when the text field code creates the new field in the table is there some reason we don't just set Allow NULL?

eristoddle’s picture

I am having this same issue.
I have installed the dev version of cck for drupal 5.0.
I am using mysql 5.
I get this error:

* user warning: Table 'deal23.content_field_review1' doesn't exist query: SELECT COUNT(*) FROM content_field_review1 WHERE vid = 3 AND nid = 3 in D:\Documents\Sites\deal23\newsite\includes\database.mysql.inc on line 167.
* user warning: Table 'deal23.content_field_review1' doesn't exist query: INSERT INTO content_field_review1 (field_review1_value, vid, nid) VALUES ('', 3, 3) in D:\Documents\Sites\deal23\newsite\includes\database.mysql.inc on line 167.
* user warning: Field 'field_review1_value' doesn't have a default value query: INSERT INTO content_type_reviews (field_product_review_1_value, vid, nid) VALUES ('Review 1', 3, 3) in D:\Documents\Sites\deal23\newsite\includes\database.mysql.inc on line 167.
* user warning: Field 'field_review1_value' doesn't have a default value query: INSERT INTO content_type_reviews (field_product_review_2_value, vid, nid) VALUES ('Review 2', 3, 3) in D:\Documents\Sites\deal23\newsite\includes\database.mysql.inc on line 167.
* user warning: Field 'field_review1_value' doesn't have a default value query: INSERT INTO content_type_reviews (field_product_review_3_value, vid, nid) VALUES ('Review 3', 3, 3) in D:\Documents\Sites\deal23\newsite\includes\database.mysql.inc on line 167.
* user warning: Table 'deal23.content_field_review1' doesn't exist query: SELECT field_review1_value AS value FROM content_field_review1 WHERE vid = 3 in D:\Documents\Sites\deal23\newsite\includes\database.mysql.inc on line 167.

yched’s picture

Come on, please.
The issue in this thread is _fixed_since comment #3 above. Let's stop appending unrelated issues to it.
@naphets66 : the 'Field xxx doesn't have a default value' are issue http://drupal.org/node/108094 I mentioned two post above yours.
The other ones are, well, something else, for which you need to open a proper issue with the relevant detailed description.

Maintaining the issue queue is time consuming - please do your homework, it should help everyone.

Anonymous’s picture

Status: Fixed » Closed (fixed)