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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Can't delete custom fields (DB error in 2.1 Beta 3)
Pages: [1]

Author Topic: Can't delete custom fields (DB error in 2.1 Beta 3)  (Read 901 times)

Brainwrap

  • Guest
Can't delete custom fields (DB error in 2.1 Beta 3)
September 04, 2008, 02:03:01 pm
Heya...I have a new install of 2.1 B3 on Drupal 6.4...so far everything has gone smoothly except that while creating some custom data fields, I ran into a database error. My suspicion is that the field name string is too long, but I'm not savvy enough to say for sure.

In any event, I've worked around the issue by disabling the entire group of fields and recreating new fields with shorter names, but I'd still like to delete the bad version. Unfortunately, CivicRM won't even let me delete them--I can disable them, but not delete. Here's the error; any assistance would be greatly appreciated!

Code: [Select]
[color=blue]backTrace

/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 138
, handle,
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 912
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/DB.php, PEAR_Error, 966
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/PEAR.php, DB_Error, 574
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/DB/common.php, raiseError, 1903
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/DB/mysql.php, raiseError, 898
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/DB/mysql.php, mysqlRaiseError, 327
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/DB/common.php, simpleQuery, 1216
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/DB/DataObject.php, query, 2394
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 1587
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 144
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/DAO.php, query, 862
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/BAO/SchemaHandler.php, executeQuery, 259
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php, alterFieldSQL, 1273
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php, createField, 722
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Custom/Form/DeleteField.php, deleteField, 112
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Form.php, postProcess, 246
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/StateMachine.php, mainProcess, 166
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php, perform, 63
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 232
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Custom/Page/Field.php, run, 263
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 197
/var/www/vhosts/justice4michigan.org/httpdocs/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 315
, civicrm_invoke,
/var/www/vhosts/justice4michigan.org/httpdocs/includes/menu.inc, call_user_func_array, 346
/var/www/vhosts/justice4michigan.org/httpdocs/index.php, menu_execute_active_handler, 18[/color]

Sorry. A non-recoverable error has occurred.
DB Error: not found

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


Code: [Select]
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_alternate_workplace_info_2 DROP COLUMN `alt_state_province_19`, DROP FOREIGN KEY FK_civicrm_value_alternate_workplace_info_2_alt_state_province_19 [nativecode=1091 ** Can't DROP 'alt_state_province_19'; check that column/key exists]
    [type] => DB_Error
    [user_info] =>         ALTER TABLE civicrm_value_alternate_workplace_info_2 DROP COLUMN `alt_state_province_19`, DROP FOREIGN KEY FK_civicrm_value_alternate_workplace_info_2_alt_state_province_19 [nativecode=1091 ** Can't DROP 'alt_state_province_19'; 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_alternate_workplace_info_2 DROP COLUMN `alt_state_province_19`, DROP FOREIGN KEY FK_civicrm_value_alternate_workplace_info_2_alt_state_province_19 [nativecode=1091 ** Can't DROP 'alt_state_province_19'; check that column/key exists]"]
)
[/code]
« Last Edit: September 04, 2008, 02:06:30 pm by Brainwrap »

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Can't delete custom fields (DB error in 2.1 Beta 3)
September 05, 2008, 04:35:04 am
Can you replicate the same on http://sandbox.civicrm.org/
and if it replicates, can you please file an issue (http://issues.civicrm.org/)

-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Can't delete custom fields (DB error in 2.1 Beta 3)

This forum was archived on 2017-11-26.