0

I'm not sure if it's a bug but when I try to delete a custom field it shows me a loading screen that never finishes.

enter image description here

Additionally if I enable this custom data set for the contact and if I need to see the contact it shows me the following error

PEAR_Exception: DB Error: no such field in /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 922

  • DB_Error: DB Error: no such field in unknown on line unknown

     0    CRM_Core_Error::exceptionHandler()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:922
     1    PEAR_Error->__construct()   /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php:997
     2    DB_Error->__construct() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:575
    3 PEAR::_raiseError() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:223
    4 PEAR->__call()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php:1928
    5 DB_common->raiseError() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php:936
    6 DB_mysqli->mysqliRaiseError()   /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php:406
    7 DB_mysqli->simpleQuery()    /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php:1234
    8 DB_common->query()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:2696
    9 DB_DataObject->_query() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:1829
    10    DB_DataObject->query()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:472
    11    CRM_Core_DAO->query()   /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:1637
    12    CRM_Core_DAO::executeQuery()    /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php:783
    13    CRM_Core_BAO_CustomGroup::buildTreeEntityDataFromQuery()    /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php:732
    14    CRM_Core_BAO_CustomGroup::buildEntityTreeSingleFields() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php:621
    15    CRM_Core_BAO_CustomGroup::getTree() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php:53
    16    CRM_Contact_Page_View_Summary->preProcess() /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/View/Summary.php:77
    17    CRM_Contact_Page_View_Summary->run()    /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:319
    18    CRM_Core_Invoke::runItem()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:69
    19    CRM_Core_Invoke::_invoke()  /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:36
    20    CRM_Core_Invoke::invoke()   /bitnami/wordpress/wp-content/plugins/civicrm/civicrm.php:1199
    21    CiviCRM_For_WordPress->invoke() /opt/bitnami/wordpress/wp-includes/class-wp-hook.php:307
    22    WP_Hook->apply_filters()    /opt/bitnami/wordpress/wp-includes/class-wp-hook.php:331
    23    WP_Hook->do_action()    /opt/bitnami/wordpress/wp-includes/plugin.php:476
    24    do_action() /opt/bitnami/wordpress/wp-admin/admin.php:259
    

enter image description here

3
  • Hi Suri! When posting these issues, it's best to include the text and not just a screenshot - it's easier for folks to search, and accessible to blind folks. It's also best to include the full debug and backtrace: Enable at Administer menu » System Settings » Debugging and Error Handling. Finally, the screen that never finishes won't show an error on-screen. If you know how to use the Developer toolbar Network tab, you can find the error in the AJAX response. Otherwise check the CiviCRM logs: See the top two answers on civicrm.stackexchange.com/q/15931/12 and edit your question? Commented Sep 14, 2022 at 17:09
  • also if you disable pop-ups, or right click the link for Delete Field, then instead of just spinning you may get additional information - not necessarily in this case but as a general rule
    – petednz - fuzion
    Commented Sep 15, 2022 at 4:42
  • Thank you for posting the backtrace - but I don't see the accompanying (extended) error message, which should include a SQL statement and the SQL error that caused it. My guess though? When you create a custom field group, it creates both a record in civicrm_custom_group and a new table (starting with civicrm_value_. Creating a custom field creates both a record in civicrm_custom_field and also a column in the corresponding table. This error may occur if those get out of sync - e.g. if you delete one manually without the other, or you partially restore a database. Commented Sep 15, 2022 at 16:56

1 Answer 1

0

The custom field wasn't created properly at the initial stage hence it is causing problems to delete now.

If you have access to the database you can delete using below query

DELETE FROM civicrm_custom_field WHERE id = 123;

Replace 123 with custom field ID

HTH

Pradeep

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.