I was cleaning up some extra custom fields in our DB. ONe of these , though it was disabled did not stop displaying in the contact profile. So I clicked to delete it.
I then got this error when I tried to do anything in Civi:
CiviCRM_API3_Exception: Expected one CustomField but found 0 in civicrm_api3() (line 45 of /var/www/crm/sites/all/modules/civicrm/api/api.php).
I tried commenting out the offending code in api.php, which got me past the error, but produced a whole bunch more warnings.
I saw in the table -
civicrm_custom_field, that the record for the field that I tried to delete was still there. I manually deleted it but that did not help.
IN this situation I can;t get into CiviCRM at all to turn on backtrace or any other logging.
Really and truly stuck. Any help would be appreciated.