Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.x-dev
Component:
General
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2007 at 13:08 UTC
Updated:
10 Mar 2007 at 04:48 UTC
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
Comment #1
lias commentedI 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
Comment #2
yched commentedThis 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.
Comment #3
yched commentedI 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)
Comment #4
yched commentedI committed the update function for 4.7 (and updated the one already added to 5.0 and HEAD)
Comment #5
sfa commentedIm 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?
Comment #6
yched commentedCCK 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
Comment #7
liquidcms commentedsorry. changed this to active
i was getting this error:
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.
Comment #8
liquidcms commentedand yes... modifying the table node_field_instance and setting display_settings field to Allow NULL fixes the problem.
Comment #9
yched commentedThere'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 ?
Comment #10
liquidcms commentedyup, 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,
Comment #11
yched commentedYes, the fix does _not_ alter the table definition, but ensures that a value is always provided.
Setting to fixed - reopen if not
Comment #12
liquidcms commentedok, 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
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.
Comment #13
yched commentednot 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.
Comment #14
liquidcms commentedok , 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?
Comment #15
eristoddle commentedI 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.
Comment #16
yched commentedCome 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.
Comment #17
(not verified) commented