I've got a 5.8.2 install on Drupal 7.61. When I try to add a new Financial Type, from /civicrm/admin/financial/financialType?reset=1
, and click Add Financial Type
button, after I enter the info and hit Save
, what I see in the GUI is that the spinner spins forever, never returning control to the user. The debug log shows (I've put some hard newlines in for readability):
[to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::exceptionHandler prefix=""
info="INSERT INTO civicrm_financial_account (name , contact_id , financial_account_type_id , account_type_code , description ,
is_header_account , is_deductible , is_tax , is_active , is_default )
VALUES ('New Fin Type' , 1 , 3 , 'INC' , 'New Fin Type descript' , 0 , 0 , 0 , 1 , 0 )
[nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`drupals_uherocrm2`.`civicrm_financial_account`,
CONSTRAINT `FK_civicrm_financial_account_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]"]
What this seems to show is that it is trying to create a new Financial Account (which I don't really understand because I thought I was only creating a Fin Type), but the Account needs to be linked to an existing Contact, and it's using contact_id=1 as a generic default? But I don't have a Contact with this id=1 in my system.
Any clues what's going on here? The GUI for creating a Fin Type is simple and doesn't given any clues about being linked to a Fin Account, at least not at creation time. Thanks.
Edit: Here is a pastebin of part of my error log, including two examples (which should be equivalent and redundant) of the constraint violation, along with a whole bunch of other junk besides the backtrace, whose value I wasn't sure of, so it was safer to include it. I've edited the file a little to remove my real domain name, just for a little more anonymity. Hope this helps to clarify: https://paste.pound-python.org/raw/15EPAPfiKEuG7T3in945/