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
Pages: [1]

Author Topic: Can't delete custom fields  (Read 537 times)

Caine

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: idk
  • CMS version: drupal
  • MySQL version: idk
  • PHP version: idk
Can't delete custom fields
December 01, 2014, 01:44:43 pm
Hi all,

I'm having some trouble with the custom fields.
Creating is no problem, but filling them out ends in an error and deleting won't work either.
I get the Error: DB not found message.

Any suggestions would be very much appreciated.

Thanks,

Caine

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Can't delete custom fields
December 01, 2014, 01:56:25 pm
This information is too vague to be useful. Please help us help you.
  • Turn on debug-backtrace and post the entire trace.
  • Post complete steps to reproduce the problem.
  • Please try to reproduce the issue on the demo site.
Try asking your question on the new CiviCRM help site.

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Can't delete custom fields
December 01, 2014, 02:09:30 pm
To turn on debugging and backtrace, go to Administer menu > System Settings > Debugging and Error Handling and from there you can select "Enable Debugging" and "Enable Backtrace".  Then, repeat the problem that caused the error, and report back the complete text of what you see.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Caine

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: idk
  • CMS version: drupal
  • MySQL version: idk
  • PHP version: idk
Re: Can't delete custom fields
December 02, 2014, 06:48:39 am
Thank you for the instructions!

When I try to delete a custom field, this is what I get:


backTrace

#0 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/DB.php(969): PEAR_Error->PEAR_Error("DB Error: not found", -4, 16, (Array:2), "        ALTER TABLE civicrm_value_atelier_employee_badge_16 DROP COLUMN `badg...")
#4 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-4, 16, (Array:2), "        ALTER TABLE civicrm_value_atelier_employee_badge_16 DROP COLUMN `badg...")
#5 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -4, NULL, NULL, "        ALTER TABLE civicrm_value_atelier_employee_badge_16 DROP COLUMN `badg...", "DB_Error", TRUE)
#6 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-4, NULL, NULL, NULL, "1091 ** Can't DROP 'badge_access_level_46'; check that column/key exists")
#7 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
#8 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("        ALTER TABLE civicrm_value_atelier_employee_badge_16 DROP COLUMN `badg...")
#9 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/DB/DataObject.php(2421): DB_common->query("        ALTER TABLE civicrm_value_atelier_employee_badge_16 DROP COLUMN `badg...")
#10 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/DB/DataObject.php(1613): DB_DataObject->_query("        ALTER TABLE civicrm_value_atelier_employee_badge_16 DROP COLUMN `badg...")
#11 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/DAO.php(155): DB_DataObject->query("        ALTER TABLE civicrm_value_atelier_employee_badge_16 DROP COLUMN `badg...")
#12 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/DAO.php(917): CRM_Core_DAO->query("        ALTER TABLE civicrm_value_atelier_employee_badge_16 DROP COLUMN `badg...", FALSE)
#13 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/BAO/SchemaHandler.php(293): CRM_Core_DAO::executeQuery("        ALTER TABLE civicrm_value_atelier_employee_badge_16 DROP COLUMN `badg...", (Array:0), TRUE, NULL, FALSE, FALSE)
#14 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php(1821): CRM_Core_BAO_SchemaHandler::alterFieldSQL((Array:7), FALSE, TRUE)
#15 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php(1075): CRM_Core_BAO_CustomField::createField(Object(CRM_Core_DAO_CustomField), "delete")
#16 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Custom/Form/DeleteField.php(114): CRM_Core_BAO_CustomField::deleteField(Object(CRM_Core_DAO_CustomField))
#17 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/Form.php(246): CRM_Custom_Form_DeleteField->postProcess()
#18 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#19 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(60): CRM_Core_StateMachine->perform(Object(CRM_Custom_Form_DeleteField), "next", "Next")
#20 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Custom_Form_DeleteField), "next")
#21 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Custom_Form_DeleteField), "next")
#22 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/Controller.php(316): HTML_QuickForm_Page->handle("next")
#23 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Custom/Page/Field.php(250): CRM_Core_Controller->run()
#24 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/Invoke.php(292): CRM_Custom_Page_Field->run((Array:5), NULL)
#25 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/Invoke.php(70): CRM_Core_Invoke::runItem((Array:14))
#26 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:5))
#27 /mnt/www/html/belcham/docroot/sites/all/modules/civicrm/drupal/civicrm.module(436): CRM_Core_Invoke::invoke((Array:5))
#28 [internal function](): civicrm_invoke("admin", "custom", "group", "field")
#29 /mnt/www/html/belcham/docroot/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:4))
#30 /mnt/www/html/belcham/docroot/index.php(21): menu_execute_active_handler()
#31 {main}
Sorry but we are not able to provide this at the moment.
DB Error: not found



Caine

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: idk
  • CMS version: drupal
  • MySQL version: idk
  • PHP version: idk
Re: Can't delete custom fields
December 04, 2014, 07:24:58 am
Anyone?  :)

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: Can't delete custom fields
December 04, 2014, 08:25:12 am

U'll need some sql skills to help debug and fix this

based on the mysql error message, seems like the column badg..... does not exist

might want to take a look and see what columns are rpesent and how they match to the custom group/field description

i suspect they are mis-matched and hence the above issue

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

Caine

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: idk
  • CMS version: drupal
  • MySQL version: idk
  • PHP version: idk
Re: Can't delete custom fields
December 04, 2014, 09:27:04 am
Thanks for your input Donald.

When I access the database through Workbench I do find the custom fields in civicrm_custom_field and civicrm_custom_group.
So they do seem to exist.

What kind of mismatch could there be?

Also, I can't add any data to the fields through CiviCRM. The names of the fields are showing, but there are no textboxes.

Thank you for your help.

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: Can't delete custom fields
December 04, 2014, 12:55:02 pm

the tables custom_group and custom_fields hold values for a new table and columns that are created in your mysql db

i suspect the values in the custom_* tables do not match the table/column definitions

the custom_* tables are quite easy to understand, so might make sense when u r looking at the db in workbench

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

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

This forum was archived on 2017-11-26.