Answers.Body: <p>Problem is likely to be that older civicrm gave an unhelpful incorrect warning when the issue was actually trying to delete a Contact that still had a connection to a CMS User</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-07T04:08:00.307Z
Answers.LastActivityDate: 2024-05-07T04:08:00.307Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>The contact was an individual, not an organisation. Examining the code in /vendor/civicrm/civicrm-core/CRM/Contact/Form/Task/Delete.php and /vendor/civicrm/civicrm-core/CRM/Contact/BAO/Contact.php showed that this message could be triggered by the user having an associated Drupal account. This proved to be the case - deleting their account allowed their Contact record to be deleted. Is there a case for updating the code so the error messages are more meaningful?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-22T20:02:09.267Z
Comments.Text: never seen this. can you pls confirm what CMS you are using
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-22T20:04:54.710Z
Comments.Text: I just tried to replicate on 5.70.x via the following (drupal) - create new contact - add CMS user - delete new contact - no such msg. can you confirm if what you are doing is replicable and if so, what steps to take
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-23T15:12:38.000Z
Comments.Text: It might not be in 5.70. It might be due to https://github.com/civicrm/civicrm-core/pull/29026. But the message has been updated in https://github.com/civicrm/civicrm-core/pull/30053 in 5.74.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-24T08:46:19.970Z
Comments.Text: We saw it in 5.72.1 under Drupal. CRM_Contact_BAO_Contact::deleteContact returns TRUE if successful and FALSE if not. One reason for failure is that it finds a ufMatch to the CMS. However, <Drupal root>/vendor/civicrm/civicrm-core/CRM/Contact/Form/Task/Delete.php currently just gives the above message on FALSE, PR https://github.com/civicrm/civicrm-core/pull/30053 does a ufMatch test and gives a sensible message if it finds one.
Comments.UserDisplayName: Stephen Palmstrom
Tags: <contacts><core>
Title: Attempting to delete a contact gives 'The contact might be the Membership Organization of a Membership Type.'
ThreadText: # Attempting to delete a contact gives 'The contact might be the Membership Organization of a Membership Type.'
  
  (Asked by: username_0 on 2024-04-22)
  
  The contact was an individual, not an organisation. Examining the code in /vendor/civicrm/civicrm-core/CRM/Contact/Form/Task/Delete.php and /vendor/civicrm/civicrm-core/CRM/Contact/BAO/Contact.php showed that this message could be triggered by the user having an associated Drupal account. This proved to be the case - deleting their account allowed their Contact record to be deleted. Is there a case for updating the code so the error messages are more meaningful?
  
  **Tags:** contacts, core
  
  > **Comments:**
  > **username_1**: never seen this. can you pls confirm what CMS you are using  
  > **username_1**: I just tried to replicate on 5.70.x via the following (drupal) - create new contact - add CMS user - delete new contact - no such msg. can you confirm if what you are doing is replicable and if so, what steps to take  
  > **username_2**: It might not be in 5.70. It might be due to https://github.com/civicrm/civicrm-core/pull/29026. But the message has been updated in https://github.com/civicrm/civicrm-core/pull/30053 in 5.74.  
  > **username_0**: We saw it in 5.72.1 under Drupal. CRM_Contact_BAO_Contact::deleteContact returns TRUE if successful and FALSE if not. One reason for failure is that it finds a ufMatch to the CMS. However, <Drupal root>/vendor/civicrm/civicrm-core/CRM/Contact/Form/Task/Delete.php currently just gives the above message on FALSE, PR https://github.com/civicrm/civicrm-core/pull/30053 does a ufMatch test and gives a sensible message if it finds one.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-05-07. Score: 0
  
  Problem is likely to be that older civicrm gave an unhelpful incorrect warning when the issue was actually trying to delete a Contact that still had a connection to a CMS User
  
  
  ---
  
  