When I add a text field to a content type, I get a warning message :

  • user warning: BLOB/TEXT column 'field_fieldname_value' can't have a default value query: content_db_add_column ALTER TABLE node_mynode ADD COLUMN field_fieldname_value longtext NOT NULL default '' in D:\...\includes\database.mysqli.inc on line 151.

The column is not created in the database table. I can create it manually by executing the SQL query without "default '' ".

I have read that I get this error because MySQL (5.0.27) runs in strict mode, but I have also read that Drupal 5.0 should be compatible with strict mode.

Next I have some trouble when I want to add a node. I get a suite of error messages :

  • # user warning: Field 'field_one_value' doesn't have a default value query: content_field INSERT INTO node_mynode (field_one_value, vid, nid) VALUES ('One', 45, 45) in D:\...\includes\database.mysqli.inc on line 151.
  • # user warning: Field 'field_two_value' doesn't have a default value query: content_field INSERT INTO node_mynode (field_two_value, vid, nid) VALUES ('Two', 45, 45) in D:\...\includes\database.mysqli.inc on line 151.
  • # user warning: Field 'field_three_value' doesn't have a default value query: content_field INSERT INTO node_regate (field_three_value, vid, nid) VALUES ('Three', 45, 45) in D:\...\includes\database.mysqli.inc on line 151.

I understand that this is because the is no default values for text in database, but I do not understand why the insert is not done with a single SQL command like :

  • INSERT INTO node_regate (field_one_value, field_two_value, field_three_value, vid, nid) VALUES ('One', 'Two', 'Three', 45, 45)

Frederic

Comments

karens’s picture

We need to know what type of field you were creating in the first instance and updating in the second. You can make this easier by enabling the content_copy module that comes bundled with CCK and exporting the content type(s) in question and pasting the export here so we can see how you have the fields set up.

The program doesn't do a single update command because fields are not necessarily in the same table. Sometimes they are all in different tables, sometimes one or more are in the same table and another is in a different table. Instead of convoluted logic trying to figure out how many inserts are needed and which can be grouped, each is performed separately. Plus, CCK works by cycling through each field module, allowing it to do its own processing, and then inserting/updating it, so doing one query at a time fits best into the processing flow.

flebas’s picture

Fields are text fields in both cases. Text/Text field when creating, Text/Text field and Text/Select list when updating.

I created a new content type, athen added a new textfield and I get this error : user warning: BLOB/TEXT column 'field_text_field_value' can't have a default value query: content_db_add_column ALTER TABLE node_cckbug ADD COLUMN field_text_field_value longtext NOT NULL default '' in D:\Inetpub\wwwroot\Fireball\includes\database.mysqli.inc on line 151.

Export of new content type :
$content[type] = array ( 'name' => 'MyContent', 'type' => 'cckbug', 'description' => 'CCK/MySQL bug content', 'title_label' => 'Titre', 'body_label' => '', 'min_word_count' => '0', 'help' => '', 'node_options' => array ( 'status' => false, 'promote' => false, 'sticky' => false, 'revision' => false, ), 'comment' => '0', 'image_attach' => '0', 'upload' => '0', 'old_type' => 'cckbug', 'orig_type' => '', 'module' => 'node', 'custom' => '1', 'modified' => '1', 'locked' => '0', ); $content[fields] = array ( 0 => array ( 'widget_type' => 'text', 'label' => 'Text Field', 'weight' => '0', 'rows' => '1', 'description' => '', 'group' => false, 'required' => '0', 'multiple' => '0', 'text_processing' => '0', 'max_length' => '', 'allowed_values' => '', 'allowed_values_php' => '', 'field_name' => 'field_text_field', 'field_type' => 'text', 'module' => 'text', ), );

yched’s picture

Status: Active » Fixed

Something got mixed up when the fix in http://drupal.org/node/101946 got committed. The lines did not get added in the right place.
Possible reason is that the code is quite different in 4.7 and 5.0 branches, see below.

This should now be fixed in 1.x-dev branches, but could probably use some testing.

Side note to fellow cck maintainers :
the code is different in 4.7 and 5.0 because JonBob's commit for content_admin.inc 1.12.2.7 in 4.7 branch did not get backported to the HEAD branch at that time, and thus did not make it to the 5.0 branch.
It was supposed to fix things for pgsql, with the creation of the helper content_db_construct_column_type function, and some naughty stuff going on between $type and $basetype.

We do not have that in 5.0, and - same old same old - we do not really now how well it supports pgsql...

yched’s picture

PS to my technical mumble :
see http://drupal.org/node/74535 for the original pgsql patch - the issue got closed while waiting for a HEAD commit and we lost track of that when we arrived.

flebas’s picture

I have looked at 5.x-1.2 code.

There is some code to clear $default in content_db_add_column function (lines 1067 to 1071), but $default variable can be set later to some code (lines 1082, 1089).

If I add the patch just before the ALTER TABLE query, I can add fields without problem.

This easily fix the field creation problem, but the data insertion problem remains. Since there is no default values for text fields, the Insert command returns an error :

* user warning: Field 'field_lieu_value' doesn't have a default value query: INSERT INTO node_livre (field_reference_value, vid, nid) VALUES (123, 2, 2) in ..\includes\database.mysqli.inc on line 151.

Since there are some errors, I don't know exactly how SQL commands are executed. I presume that there is a first INSERT command to create the record then some UPDATE commands to set the field values for the same nid.

The first insert command should contain default values for all fields that do not have default value defined in the database :
INSERT INTO node_livre (field_reference_value, field_lieu, vid, nid) VALUES (123, '', 2, 2) .

Another solution that seems to work is to allow NULL values when creating text fields.

flebas’s picture

I see that is bug is marked as fixed but I think this is not the case. Only the problem of adding new fields is fixed, not the problem when adding node.

I had to manually edit database (change NOT NULL attribute to NULL on text columns) to add new content, and I don't know Drupal enough to tell if this change can have side effects. However, I think that full fix should include creation of fields with the proper attributes.

yched’s picture

Title: MYSQL error when adding field and when adding node » MYSQL error when adding node
Status: Fixed » Active

It was marked as fixed because was not aware we had another problem during data insert :-)

I'm not really sure what's the best way to fix this right now.
I'll try to investigate when I have some time

yched’s picture

Title: MYSQL error when adding node » MYSQL (5) error when adding node

Updating to a less dramatic title
Does not mean we don't have to fix it though...

littleprince’s picture

Has there been an update to this? Seems more like a Drupal 5 bug than a CCK bug to me since I've noticed this on other modules such as Category. Was just wondering because I'm re-evaluating CMS for a huge website I need to work on and the Taxnomy of Drupal would make it an excellent choice over Joomla which I usualy use.

lias’s picture

This error occurs no matter what type of field I try to add to a new content type using cck. I'm using MySql 5.0.1.8 and CCK // $Id: CHANGELOG.txt,v 1.1.4.16 2007/02/01 15:07:40 karens Exp $ 5--1.3 .

So it kind of makes adding fields and using CCk useless if I keep getting this error. So I wonder if it is ok to use the workaround :

manually edit database (change NOT NULL attribute to NULL on text columns) to add new content

that flebas offered?

I also use this CCK version on a server with MySQL 4x and adding fields works fine.

thanks.
lsabug

littleprince’s picture

I have tried manually creating the fields table in the database with the not null removed. Did not seem to have an adverse effect.

You can also remove the strict option from mysql if it's a local server.

This seems to me to be a problem with the core itself rather than CCK to me because multiple modules are having the same problem.

yched’s picture

Just to clear things a little:
the error reported by lsabug in #10 (error on creation of any field) is unrelated and should now be fixed : http://drupal.org/node/115332

What we have now is 'only' an error for text fields

liquidcms’s picture

ok, just want to track this so thought i would add a post... since i was posting this problem on the "other" somewhat similar issue that yshed mentions in #12.

so just to state my findings.. which i think match above.

- i use drupal 4.7
- i use MySQL 5.0

i see this issue when i add a node that has a text field

i have fixed it in my cases by setting "allow null" on those fields

Peter Lindstrom
LiquidCMS - Content Management Solution Experts

Emmental’s picture

Here is the reason for the problem as I see it. MySQL 5 doesn't allow default values for text fields, and CCK is setting those fields to NOT NULL.

This wouldn't be a problem if CCK used a single query to insert data into the table since empty text fields would be entered as '' (which is not the same as null). In fact, if you only have a single text field defined in your content type (meaning no other fields at all) and leave it blank on the entry form then this is exactly what it does and it works fine.

However, because CCK uses a separate insert query for every field (the reasons for this were discussed elsewhere but I can't remeber where now) any text fields will throw the error when you have more than one field (of any type) because they are not being provided with a value.

So as long as CCK uses separate queries the only way I see to fix the problem is by allowing null entries in text fields. This can be done permanently by finding the following code in CCK's content_admin.inc at line 1338 (cck-5.x-1.x-dev):

if (in_array($type, array('text', 'mediumtext', 'longtext'))) {
  $default = '';
}

and adding the $not_null line as shown:

if (in_array($type, array('text', 'mediumtext', 'longtext'))) {
  $default = '';
  $not_null = FALSE;
}

This will mean that you will no longer have to manually change field definitions or MySQL settings. Note that this only applies to newly created fields and does not account for any changes that might be made by running Drupal's update.php. I'm not sure of any side-effects that may arise from this change, but other posters suggest that allowing nulls is fine.

yched’s picture

@Emmental : that's a very precise sum up of the issue and of the probable 'best' fix for this - except $not_null should rather be set to '' (empty string), and that the same line should be added on 1438 as well.

I have been hesitating on this fix for a few weeks, but it's probably time to go ahead now :-)
So I'll probably be committing this when I have the update function (to take care of existing fields) ready.

yched’s picture

I committed the fix and the update function to DRUPAL-5 branch.
4.7 version tomorrow :-)

yched’s picture

Status: Active » Fixed

fix committed to 4.7 branch.
This should be fixed now - however I don't have any MySQL 5 install to actually test, so please reopen if necessary

mordonez’s picture

I think the error its with the 'display_settings' column.

rssaddict’s picture

Status: Fixed » Active

This is still a problem. The display_settings field generates an error when using MySQL 5.0 in strict mode. The simple workaround is to put this code into the my.ini file:

sql_mode=MYSQL40

This will make MySQL 5 behave like MySQL 4 and play nice with Drupal (this goes for the problem with the Aggregator module as well.)

yched’s picture

Status: Active » Fixed

No. The 'display_settings' error is another issue, absolutely unrelated to this one.
Both errors should be fixed in latest 1.x-dev package. We have a new official 1.4 release coming out pretty soon.
Meanwhile, _please_ make sure you're running latest 1.x-dev code, the 'display_settings' issue has been erroneously reported several times now.
If the error still happens, please report in http://drupal.org/node/115332

Anonymous’s picture

Status: Fixed » Closed (fixed)
liquidcms’s picture

Status: Closed (fixed) » Active

sorry to re-open.. but not sure why this and the other related issue have both been closed when the issue still seems to prevail... or has it been moved to a new issue???

I have just finished my last 4.7 project and starting on a 5.1 project. I have what i think is latest version of CCK (5.x-1.5) and MySQL 5.

When i create a new node using custom cck type i get:



    * user warning: Field 'field_courriel_email' doesn't have a default value query: INSERT INTO content_type_contact (field_contact_value, vid, nid) VALUES ('Mickey Mouse', 2, 2) in C:\Inetpub\websites\drupal-5.1\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_courriel_email' doesn't have a default value query: INSERT INTO content_type_contact (field_address_street1, field_address_street2, field_address_apt, field_address_city, field_address_state, field_address_zip, field_address_country, field_address_other, vid, nid) VALUES ('123 Anywhere St.', NULL, NULL, 'Anaheim', 'QC', 'J8V 2V4', 'CA', NULL, 2, 2) in C:\Inetpub\websites\drupal-5.1\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_courriel_email' doesn't have a default value query: INSERT INTO content_type_contact (field_tel_value, vid, nid) VALUES ('1 --', 2, 2) in C:\Inetpub\websites\drupal-5.1\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_courriel_email' doesn't have a default value query: INSERT INTO content_type_contact (field_cell_ou_telec_value, vid, nid) VALUES ('1 819-789-3210', 2, 2) in C:\Inetpub\websites\drupal-5.1\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_courriel_email' doesn't have a default value query: INSERT INTO content_type_contact (field_telec_value, vid, nid) VALUES ('1 819-555-4444', 2, 2) in C:\Inetpub\websites\drupal-5.1\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_tel_value' doesn't have a default value query: INSERT INTO content_type_contact (field_courriel_email, vid, nid) VALUES ('mickey@liquidcms.ca', 2, 2) in C:\Inetpub\websites\drupal-5.1\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_courriel_email' doesn't have a default value query: INSERT INTO content_type_contact (field_cot_value, vid, nid) VALUES (75, 2, 2) in C:\Inetpub\websites\drupal-5.1\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_courriel_email' doesn't have a default value query: INSERT INTO content_type_contact (field_pub_value, vid, nid) VALUES (100, 2, 2) in C:\Inetpub\websites\drupal-5.1\includes\database.mysql.inc on line 172.

looks like the same issue to me.

Peter Lindstrom
LiquidCMS - Content Management Solution Experts

lias’s picture

Same issue I believe with latest cck versions, 5.1 and mysql 5.0.18:


# ser warning: Field 'field_phone2_value' doesn't have a default value query: INSERT INTO content_type_department (field_staff2_first, field_staff2_middle, field_staff2_last, vid, nid) VALUES ('Mist', '', 'Now', 30, 30) in D:\www\public_html\domain\includes\database.mysql.inc on line 172.
# user warning: Field 'field_phone2_value' doesn't have a default value query: INSERT INTO content_type_department (field_title2_value, vid, nid) VALUES ('Public Specialist', 30, 30) in D:\www\public_html\domain\includes\database.mysql.inc on line 172.
# user warning: Field 'field_phone3_value' doesn't have a default value query: INSERT INTO content_type_department (field_phone2_value, vid, nid) VALUES ('1 000-000-0000', 30, 30) in D:\www\public_html\domain\includes\database.mysql.inc on line 172.
# user warning: Field 'field_phone2_value' doesn't have a default value query: INSERT INTO content_type_department (field_staff3_first, field_staff3_middle, field_staff3_last, vid, nid) VALUES ('Lail', '', 'Sar', 30, 30) in D:\www\public_html\domain\includes\database.mysql.inc on line 172.
# user warning: Field 'field_phone2_value' doesn't have a default value query: INSERT INTO content_type_department (field_title3_value, vid, nid) VALUES ('Accountant/Internal Control Auditor', 30, 30) in

I entered in the content and created groups for staff member 1, 2, etc. The staff members after the first group created were not saved to the database and I got the error message. There are no naming conflicts afaik.

foxtrotcharlie’s picture

Version: 5.x-1.2 » 5.x-1.5

I'm getting a similar error using MySQL 5.0.27 and Drupal 5.2 when I add a new CCK node with some fields not filled in:

    * user warning: Field 'field_email_email' doesn't have a default value query: content_field INSERT INTO content_type_whatever (field_town_value, vid, nid) VALUES (19, 18, 18) in ...includes\database.mysql.inc on line 172.
    * user warning: Field 'field_email_email' doesn't have a default value query: content_field INSERT INTO content_type_whatever (field_house_rules_value, vid, nid) VALUES ('rules', 18, 18) in ...\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_email_email' doesn't have a default value query: content_field INSERT INTO content_type_whatever (field_telephone_value, vid, nid) VALUES ('', 18, 18) in ...\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_email_email' doesn't have a default value query: content_field INSERT INTO content_type_whatever (field_cellphone_value, vid, nid) VALUES ('', 18, 18) in ...\includes\database.mysql.inc on line 172.

In my database I see that the email field and link fields (url and url_title in this case) do not allow null values and no default value is set.

When I change those fields to allow null values, I can add a node without any errors.

lias’s picture

Version: 5.x-1.5 » 5.x-1.6-1

Sorry to be a downer but I am still experiencing this problem --when a user submits a cck node (in my case it's also an og node type) what they entered into the fields (text and an email field) is empty when submitted. I looked at my watchdog logs and found this:

Field 'field_email_email' doesn't have a default value query: INSERT INTO content_type_classroom (field_school_value, vid, nid) VALUES ('Administration', 74, 74) in D:\www\public_html\class\includes\database.mysql.inc on line 172.

and

Duplicate entry '73-0-og_public' for key 1 query: INSERT INTO node_access (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (73, 'og_public', 0, 1, 0, 0) in D:\www\public_html\class\includes\database.mysql.inc on line 172.

I'm not sure why I'm getting a duplicate entry when I've allowed for more than one group node to be created per user.

Here's my exported content type - classroom which is a group type:

$content[type]  = array (
  'name' => 'Classroom',
  'type' => 'classroom',
  'description' => 'Classroom for each teacher',
  'title_label' => 'Classroom title',
  'body_label' => '',
  'min_word_count' => '0',
  'help' => 'This is your online classroom webpage. Complete the form by adding a your first and last name, the official name of your offline class, your school and grade level and a short introduction for online visitors. When complete click on the submit button.<br><br>
**NOTE** You may have to submit your classroom twice in order for it to keep the first/last name, school and grade level text you entered.<br>',
  'node_options' => 
  array (
    'status' => true,
    'promote' => false,
    'sticky' => false,
    'revision' => false,
  ),
  'comment' => '0',
  'upload' => '0',
  'event_nodeapi' => 'never',
  'old_type' => 'classroom',
  'orig_type' => '',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
);
$content[fields]  = array (
  0 => 
  array (
    'widget_type' => 'text',
    'label' => 'First name',
    'weight' => '-8',
    'rows' => '1',
    'description' => 'Please enter your first name as listed in your school roster',
    'default_value_widget' => 
    array (
      'field_fname' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_fname',
    'field_type' => 'text',
    'module' => 'text',
    'default_value' => 
    array (
      0 => 
      array (
        'value' => '',
      ),
    ),
  ),
  1 => 
  array (
    'widget_type' => 'text',
    'label' => 'Last name',
    'weight' => '-7',
    'rows' => '1',
    'description' => 'Please enter your last name as listed in your school\'s roster',
    'default_value_widget' => 
    array (
      'field_lname' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_lname',
    'field_type' => 'text',
    'module' => 'text',
  ),
  2 => 
  array (
    'widget_type' => 'options_select',
    'label' => 'Grade',
    'weight' => '-6',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_grade' => 
      array (
        'key' => 'Select grade from list:',
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => 'Select grade from list:
Preschool
Kindergarten
1st Grade
2nd Grade
3rd Grade
4th Grade
5th Grade
6th Grade
7th Grade
8th Grade
9th Grade
10th Grade
11th Grade
12th Grade
Multiple Grades
Other',
    'allowed_values_php' => '',
    'field_name' => 'field_grade',
    'field_type' => 'text',
    'module' => 'text, optionwidgets',
  ),
  3 => 
  array (
    'widget_type' => 'options_select',
    'label' => 'School',
    'weight' => '-6',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_school' => 
      array (
        'key' => 'Select school from list:',
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => 'Select school from list:
Special Education
Administration
Admin-Information Technologies
Other',
    'allowed_values_php' => '',
    'field_name' => 'field_school',
    'field_type' => 'text',
    'module' => 'text, optionwidgets',
  ),
  4 => 
  array (
    'widget_type' => 'email',
    'label' => 'Email address',
    'weight' => '-5',
    'size' => '60',
    'link_type' => 'form',
    'description' => 'Enter your district email address in the format: username@domain.org',
    'default_value_widget' => 
    array (
      'field_email' => 
      array (
        0 => 
        array (
          'email' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'field_name' => 'field_email',
    'field_type' => 'email',
    'module' => 'email',
  ),
  5 => 
  array (
    'widget_type' => 'text',
    'label' => 'Introduction to my class',
    'weight' => '-3',
    'rows' => '3',
    'description' => 'Please include a brief introduction to your online classroom. ',
    'default_value_widget' => 
    array (
      'field_class_intro' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_class_intro' => 
    array (
      0 => 
      array (
        'format' => '4',
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '1000',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_class_intro',
    'field_type' => 'text',
    'module' => 'text',
  ),
);

I've got the latest versions of both cck and og. The strange thing is that some of the fields "stick" and retain the info. the user entered but other fields (like the first name, grade levels) don't. I thought by updating to the latest versions of each (using drupal 5.5 too) and MySQL 5.0.18/ PHP 5.1.2 that it would be good to go but no luck. Considering the code mod from comment http://drupal.org/node/108094#comment-489361 was back in Feb. 2007 I wasn't sure if I should do this.

newbuntu’s picture

I am using 5.6 and mysql, and still see the same problem. Trace into the code, the problem is still when there are "required" fields, which translate into database as "not null".

If there is only one "required" field that happens to be inserted first into content_type_xxx, then the insert would work, because rest of the "inserts" become "updates", therefore it works in that case. If other fields get inserted first, then it will cause problem.

dan.blah’s picture

Wasn't having this issue on the dev server and found it to be an issue on the production server. This only started happening on one of many custom node types that are using all CCK fields.

Dev Server:
OS FreeBSD 6.2-STABLE
Web server Apache/2.2.6 (FreeBSD) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 with Suhosin-Patch
PHP 5.2.5
MySQL 5.0.45
Drupal 5.7
CCK 5.x-1.6-1

Production server:
OS Windows Server 2003
Web server Microsoft-IIS/6.0
PHP 5.2.5
MySQL 5.0.51a
Drupal 5.7
CCK 5.x-1.6-1

I am getting the above error for 17 of the fields that aren't a node reference field type.

$content[type]  = array (
  'name' => 'Researcher',
  'type' => 'researcher',
  'description' => 'Researchers are principal investigators or co-investigators working on IHRP-affiliated studies, training programs or other projects.',
  'title_label' => 'Full Name with academic credential',
  'body_label' => '',
  'min_word_count' => '0',
  'help' => '',
  'node_options' => 
  array (
    'status' => true,
    'promote' => false,
    'sticky' => false,
    'revision' => false,
  ),
  'comment' => '0',
  'upload' => '1',
  'event_nodeapi' => 'never',
  'eventrepeat_nodeapi' => 0,
  'forward_display' => 1,
  'print_display' => 1,
  'scheduler' => 1,
  'scheduler_touch' => 0,
  'old_type' => 'researcher',
  'orig_type' => '',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
  'ant' => '1',
  'ant_pattern' => '<p>[field_researcher_title-raw]</p>',
  'ant_php' => 0,
);
$content[groups]  = array (
  0 => 
  array (
    'label' => 'Basic Information',
    'settings' => 
    array (
      'form' => 
      array (
        'style' => 'fieldset_collapsible',
        'description' => '',
      ),
      'display' => 
      array (
        'description' => '',
        'teaser' => 'fieldset',
        'full' => 'fieldset',
        'label' => 'above',
      ),
    ),
    'weight' => '-8',
    'group_name' => 'group_researcher_basic_informa',
  ),
  1 => 
  array (
    'label' => 'Research Study Information',
    'settings' => 
    array (
      'form' => 
      array (
        'style' => 'fieldset_collapsible',
        'description' => '',
      ),
      'display' => 
      array (
        'description' => '',
        'teaser' => 'fieldset',
        'full' => 'fieldset',
        'label' => 'above',
      ),
    ),
    'weight' => '-6',
    'group_name' => 'group_researcher_current_ihrp_',
  ),
  2 => 
  array (
    'label' => 'Other Information',
    'settings' => 
    array (
      'form' => 
      array (
        'style' => 'fieldset_collapsible',
        'description' => '',
      ),
      'display' => 
      array (
        'description' => '',
        'teaser' => 'fieldset',
        'full' => 'fieldset',
        'label' => 'above',
      ),
    ),
    'weight' => '-5',
    'group_name' => 'group_other_information',
  ),
);
$content[fields]  = array (
  0 => 
  array (
    'widget_type' => 'text',
    'label' => 'Biographical Profile',
    'weight' => '-10',
    'rows' => '10',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_biographical_p' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_biographical_p' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_other_information',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_biographical_p',
    'field_type' => 'text',
    'module' => 'text',
    'default_value' => 
    array (
      0 => 
      array (
        'value' => '',
      ),
    ),
  ),
  1 => 
  array (
    'widget_type' => 'nodereference_select',
    'label' => 'Current IHRP Research (Principal Investigator)',
    'weight' => '-10',
    'description' => '<p>To scroll through mouse over the list and use your mouse wheel to scroll up or down through the list.  To multiple select, hold down the control key and click on the item.  To select all items in a group click on an item then hold down shift and click on the last desired item.</p>',
    'default_value_widget' => 
    array (
      'field_researcher_current_ihrp_p' => 
      array (
        'nids' => 
        array (
          0 => '0',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_current_ihrp_',
    'required' => '0',
    'multiple' => '1',
    'referenceable_types' => 
    array (
      'study' => true,
      0 => 1,
      'center' => false,
      'event' => false,
      'news' => false,
      'page' => false,
      'people' => false,
      'researcher' => false,
      'story' => false,
    ),
    'advanced_view' => '--',
    'advanced_view_args' => '',
    'field_name' => 'field_researcher_current_ihrp_p',
    'field_type' => 'nodereference',
    'module' => 'nodereference',
  ),
  2 => 
  array (
    'widget_type' => 'text',
    'label' => 'Full Name with Academic Credential (title)',
    'weight' => '-10',
    'rows' => '1',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_title' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_title' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_basic_informa',
    'required' => '1',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_title',
    'field_type' => 'text',
    'module' => 'text',
  ),
  3 => 
  array (
    'widget_type' => 'image crop',
    'label' => 'Photo',
    'weight' => '-10',
    'resolution' => '150x200',
    'enforce_ratio' => 1,
    'croparea' => '150x200',
    'always_show' => 0,
    'use_unscaled' => 1,
    'image_path' => 'researcher_image',
    'custom_alt' => 0,
    'custom_title' => 0,
    'description' => 'Select the photo from your computer by using the browse button.  You can then crop the image by clicking on the images corners.',
    'group' => false,
    'required' => '0',
    'multiple' => '0',
    'field_name' => 'field_researcher_photo',
    'field_type' => 'image',
    'module' => 'imagefield, imagefield_crop',
  ),
  4 => 
  array (
    'widget_type' => 'nodereference_select',
    'label' => 'Current IHRP Research (Co-investigator)',
    'weight' => '-9',
    'description' => '<p>To scroll through mouse over the list and use your mouse wheel to scroll up or down through the list.  To multiple select, hold down the control key and click on the item.  To select all items in a group click on an item then hold down shift and click on the last desired item.</p>',
    'default_value_widget' => 
    array (
      'field_researcher_current_ihrp_c' => 
      array (
        'nids' => 
        array (
          0 => '0',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_current_ihrp_',
    'required' => '0',
    'multiple' => '1',
    'referenceable_types' => 
    array (
      'study' => true,
      0 => 1,
      'center' => false,
      'event' => false,
      'news' => false,
      'page' => false,
      'people' => false,
      'researcher' => false,
      'story' => false,
    ),
    'advanced_view' => '--',
    'advanced_view_args' => '',
    'field_name' => 'field_researcher_current_ihrp_c',
    'field_type' => 'nodereference',
    'module' => 'nodereference',
  ),
  5 => 
  array (
    'widget_type' => 'text',
    'label' => 'Last Name',
    'weight' => '-9',
    'rows' => '1',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_last_name' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_basic_informa',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_last_name',
    'field_type' => 'text',
    'module' => 'text',
  ),
  6 => 
  array (
    'widget_type' => 'text',
    'label' => 'Research Interests',
    'weight' => '-9',
    'rows' => '4',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_interests' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_interests' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_other_information',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_interests',
    'field_type' => 'text',
    'module' => 'text',
  ),
  7 => 
  array (
    'widget_type' => 'text',
    'label' => 'Academic title (e.g., primary faculty appt.)',
    'weight' => '-8',
    'rows' => '1',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_faculty_title' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_faculty_title' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_basic_informa',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_faculty_title',
    'field_type' => 'text',
    'module' => 'text',
  ),
  8 => 
  array (
    'widget_type' => 'nodereference_select',
    'label' => 'IHRP Affiliation(s)',
    'weight' => '-7',
    'description' => '<p>To scroll through mouse over the list and use your mouse wheel to scroll up or down through the list.  To multiple select, hold down the control key and click on the item.  To select all items in a group click on an item then hold down shift and click on the last desired item.</p>',
    'default_value_widget' => 
    array (
      'field_researcher_centers' => 
      array (
        'nids' => 
        array (
          0 => '0',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_other_information',
    'required' => '0',
    'multiple' => '1',
    'referenceable_types' => 
    array (
      'center' => true,
      0 => 1,
      'event' => false,
      'news' => false,
      'page' => false,
      'people' => false,
      'researcher' => false,
      'story' => false,
      'study' => false,
    ),
    'advanced_view' => '--',
    'advanced_view_args' => '',
    'field_name' => 'field_researcher_centers',
    'field_type' => 'nodereference',
    'module' => 'nodereference',
  ),
  9 => 
  array (
    'widget_type' => 'text',
    'label' => 'Other Title(s)',
    'weight' => '-7',
    'rows' => '4',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_other_title' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_other_title' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_basic_informa',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_other_title',
    'field_type' => 'text',
    'module' => 'text',
  ),
  10 => 
  array (
    'widget_type' => 'email',
    'label' => 'E-mail Address',
    'weight' => '-6',
    'size' => '60',
    'link_type' => 'mailto_encrypt',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_email' => 
      array (
        0 => 
        array (
          'email' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_basic_informa',
    'required' => '0',
    'multiple' => '0',
    'field_name' => 'field_researcher_email',
    'field_type' => 'email',
    'module' => 'email',
  ),
  11 => 
  array (
    'widget_type' => 'text',
    'label' => 'Non-IHRP Research',
    'weight' => '-6',
    'rows' => '5',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_non_ihrp_resea' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_non_ihrp_resea' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_current_ihrp_',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_non_ihrp_resea',
    'field_type' => 'text',
    'module' => 'text',
  ),
  12 => 
  array (
    'widget_type' => 'text',
    'label' => 'Recent and Noteworthy Publications',
    'weight' => '-6',
    'rows' => '5',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_publications' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_publications' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_other_information',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_publications',
    'field_type' => 'text',
    'module' => 'text',
  ),
  13 => 
  array (
    'widget_type' => 'phone',
    'label' => 'Phone Number',
    'weight' => '-5',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_telephone' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_basic_informa',
    'required' => '0',
    'multiple' => '0',
    'field_name' => 'field_researcher_telephone',
    'field_type' => 'ca_phone',
    'module' => 'phone',
  ),
  14 => 
  array (
    'widget_type' => 'phone',
    'label' => 'Fax Number',
    'weight' => '-4',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_fax' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_basic_informa',
    'required' => '0',
    'multiple' => '0',
    'field_name' => 'field_researcher_fax',
    'field_type' => 'ca_phone',
    'module' => 'phone',
  ),
  15 => 
  array (
    'widget_type' => 'text',
    'label' => 'Address Info',
    'weight' => '-3',
    'rows' => '6',
    'description' => '<p>Please include the following:  Institution w/Dept.,  Mail Code,  Bldg Name, Office No., Street Address, City, State, and Zip</p>',
    'default_value_widget' => 
    array (
      'field_researcher_address' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_address' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_basic_informa',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_address',
    'field_type' => 'text',
    'module' => 'text',
  ),
  16 => 
  array (
    'widget_type' => 'text',
    'label' => 'Honors and Awards',
    'weight' => '-3',
    'rows' => '5',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_honors_awards' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_honors_awards' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_other_information',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_honors_awards',
    'field_type' => 'text',
    'module' => 'text',
  ),
  17 => 
  array (
    'widget_type' => 'text',
    'label' => 'Personal Website',
    'weight' => '-1',
    'rows' => '4',
    'description' => '<p>A list of websites</p>',
    'default_value_widget' => 
    array (
      'field_researcher_website' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_website' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_basic_informa',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_website',
    'field_type' => 'text',
    'module' => 'text',
  ),
  18 => 
  array (
    'widget_type' => 'text',
    'label' => 'Other Activity',
    'weight' => '0',
    'rows' => '5',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_other_activity' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_other_activity' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_current_ihrp_',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_other_activity',
    'field_type' => 'text',
    'module' => 'text',
  ),
  19 => 
  array (
    'widget_type' => 'text',
    'label' => 'Recently Completed Research',
    'weight' => '0',
    'rows' => '5',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_recently_compl' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_recently_compl' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_current_ihrp_',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_recently_compl',
    'field_type' => 'text',
    'module' => 'text',
  ),
  20 => 
  array (
    'widget_type' => 'text',
    'label' => 'Training Program(s) Served as Faculty Member',
    'weight' => '0',
    'rows' => '15',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_researcher_faculty_traini' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'field_researcher_faculty_traini' => 
    array (
      0 => 
      array (
        'format' => '3',
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_researcher_current_ihrp_',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_researcher_faculty_traini',
    'field_type' => 'text',
    'module' => 'text',
  ),
);
dan.blah’s picture

if it helps, the messages i am getting. changing to not null as stated above doesn't do it for me.

    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_biographical_p_value, field_researcher_biographical_p_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_title_value, field_researcher_title_format, vid, nid) VALUES ('Dan Blah, Uber 1337', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_telephone_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_last_name_value, vid, nid) VALUES ('', 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_interests_value, field_researcher_interests_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_faculty_title_value, field_researcher_faculty_title_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_other_title_value, field_researcher_other_title_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_email_email, vid, nid) VALUES ('', 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_non_ihrp_resea_value, field_researcher_non_ihrp_resea_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_publications_value, field_researcher_publications_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_telephone_value, vid, nid) VALUES ('', 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_fax_value, vid, nid) VALUES ('', 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_address_value, field_researcher_address_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_honors_awards_value, field_researcher_honors_awards_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_website_value, field_researcher_website_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_other_activity_value, field_researcher_other_activity_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_recently_compl_value, field_researcher_recently_compl_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
    * user warning: Field 'field_researcher_last_name_value' doesn't have a default value query: INSERT INTO content_type_researcher (field_researcher_faculty_traini_value, field_researcher_faculty_traini_format, vid, nid) VALUES ('', 3, 1687, 1687) in C:\Inetpub\websites\ihrp\includes\database.mysql.inc on line 172.
dan.blah’s picture

I was able to get this to not be an issue by changing the following in the my.ini file on the production server:

# Set the SQL mode to strict
#original
#sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

More info @ http://dev.mysql.com/doc/refman/5.1/en/constraint-invalid-data.html

lias’s picture

Before I modify my mysql.ini file I would like confirmation that this is the correct fix, I'm afraid of breaking other sites on the server that rely on mysql.
Thanks.

karens’s picture

Status: Active » Closed (won't fix)

The D5 version is no longer being supported. Sorry.