CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.1 Release Testing »
  • Error creating custom date fields
Pages: [1]

Author Topic: Error creating custom date fields  (Read 2848 times)

chrism

  • Guest
Error creating custom date fields
August 03, 2008, 07:57:58 pm
Fatal error occurs when creating a new date field in a custom group.

Recreate in the sandbox:
1. Create a new field in an existing group
2. Enter a name, and select 'Date' as the type
3. Leave all other settings as default and select 'Save'

Result is that a fatal error is shown, but when navigating back to the custom group, then field is shown added.

Example error message for the field 'Super lucky date' added to the 'Constituent' custom group on the sandbox:

unrecoverable error
    Sorry. A non-recoverable error has occurred.

    DB Error: a515ac9c2796ca0e23adbe92c68fc9fc

    Database Error Code: Invalid default value for 'super_lucky_date_10', 1067

    Return to home page.

Error Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> a515ac9c2796ca0e23adbe92c68fc9fc
    [message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
    [mode] => 16
    [debug_info] =>         ALTER TABLE civicrm_value_constituent_information_1
        ADD COLUMN `super_lucky_date_10` datetime DEFAULT 'null' [nativecode=1067 ** Invalid default value for 'super_lucky_date_10']
    [type] => DB_Error
    [user_info] =>         ALTER TABLE civicrm_value_constituent_information_1
        ADD COLUMN `super_lucky_date_10` datetime DEFAULT 'null' [nativecode=1067 ** Invalid default value for 'super_lucky_date_10']
    [to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info="        ALTER TABLE civicrm_value_constituent_information_1
        ADD COLUMN `super_lucky_date_10` datetime DEFAULT 'null' [nativecode=1067 ** Invalid default value for 'super_lucky_date_10']"]
)


backTrace

/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/Error.php, backtrace, 138
, handle,
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/PEAR.php, call_user_func, 912
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB.php, PEAR_Error, 969
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/PEAR.php, DB_Error, 574
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/common.php, raiseError, 1903
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/DataObject.php, query, 2390
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/DataObject.php, _query, 1583
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/DAO.php, query, 812
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/BAO/SchemaHandler.php, executeQuery, 259
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/BAO/CustomField.php, alterFieldSQL, 1245
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/BAO/CustomField.php, createField, 220
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Custom/Form/Field.php, create, 848
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/StateMachine.php, postProcess, 166
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/QuickForm/Action/Next.php, perform, 63
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/Controller.php, handle, 232
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Custom/Page/Field.php, run, 228
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Custom/Page/Field.php, edit, 286
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/Invoke.php, run, 192
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/drupal/civicrm.module, invoke, 314
, civicrm_invoke,
/var/www/drupal-6.civicrm.org/public/includes/menu.inc, call_user_func_array, 346
/var/www/drupal-6.civicrm.org/public/index.php, menu_execute_active_handler, 18

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error creating custom date fields
August 03, 2008, 09:15:49 pm

There were a few issues with the data type / html type for custom fields. I've fixed them, reset the db on sandbox

can you test it out a bit more. Some of the issues which i fixed have been there since a 1.x release (i think)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

chrism

  • Guest
Re: Error creating custom date fields
August 03, 2008, 11:29:31 pm
The original error appears to be fixed.

I got an error trying to delete a field from the already existing Constinuent group (see below), but I couldn't recreate with a freshly created custom group, so it may be something just corrupted from the previous bug still.


Code: [Select]

    Sorry. A non-recoverable error has occurred.

    DB Error: not found

    Database Error Code: Can't DROP 'INDEX_marriage_date_3'; check that column/key exists, 1091

    Return to home page.

Error Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -4
    [message] => DB Error: not found
    [mode] => 16
    [debug_info] =>         ALTER TABLE civicrm_value_constituent_information_1 DROP COLUMN `marriage_date_3`, DROP INDEX INDEX_marriage_date_3 [nativecode=1091 ** Can't DROP 'INDEX_marriage_date_3'; check that column/key exists]
    [type] => DB_Error
    [user_info] =>         ALTER TABLE civicrm_value_constituent_information_1 DROP COLUMN `marriage_date_3`, DROP INDEX INDEX_marriage_date_3 [nativecode=1091 ** Can't DROP 'INDEX_marriage_date_3'; check that column/key exists]
    [to_string] => [db_error: message="DB Error: not found" code=-4 mode=callback callback=CRM_Core_Error::handle prefix="" info="        ALTER TABLE civicrm_value_constituent_information_1 DROP COLUMN `marriage_date_3`, DROP INDEX INDEX_marriage_date_3 [nativecode=1091 ** Can't DROP 'INDEX_marriage_date_3'; check that column/key exists]"]
)


backTrace

/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/Error.php, backtrace, 138
, handle,
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/PEAR.php, call_user_func, 912
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB.php, PEAR_Error, 966
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/PEAR.php, DB_Error, 574
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/common.php, raiseError, 1903
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/DataObject.php, query, 2390
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/DB/DataObject.php, _query, 1583
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/DAO.php, query, 812
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/BAO/SchemaHandler.php, executeQuery, 259
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/BAO/CustomField.php, alterFieldSQL, 1245
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/BAO/CustomField.php, createField, 705
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Custom/Form/DeleteField.php, deleteField, 112
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/StateMachine.php, postProcess, 166
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/QuickForm/Action/Next.php, perform, 63
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/Controller.php, handle, 232
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Custom/Page/Field.php, run, 263
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/CRM/Core/Invoke.php, run, 192
/var/www/drupal-6.civicrm.org/public/sites/sandbox.civicrm.org/modules/civicrm/drupal/civicrm.module, invoke, 314
, civicrm_invoke,
/var/www/drupal-6.civicrm.org/public/includes/menu.inc, call_user_func_array, 346
/var/www/drupal-6.civicrm.org/public/index.php, menu_execute_active_handler, 18
[/code]

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Error creating custom date fields
August 04, 2008, 03:27:18 am
ChrisM, We couldn't replicate - looks like this has recently been fixed. Try checking /w newly created custom fields.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

chrism

  • Guest
Re: Error creating custom date fields
August 04, 2008, 06:51:57 am
Yes, I can't replicate on freshly created custom groups.  This issue seems resolved.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.1 Release Testing »
  • Error creating custom date fields

This forum was archived on 2017-11-26.