Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 5.8.1
-
Fix Version/s: 5.8.2
-
Component/s: None
-
Labels:None
Description
To reproduce:
- Create a secondary contact without a login
- Try to delete
- Get a success message but see that the contact is not deleted
To resolve:
In app/models/contacts.php around line 441 change
$this->Record->from('contacts') ->leftJoin('contact_numbers', 'contact_numbers.contact_id', '=', 'contacts.id', false) ->leftJoin('contact_permissions', 'contact_permissions.contact_id', '=', 'contacts.id', false) ->leftJoin('email_verifications', 'email_verifications.contact_id', '=', 'contacts.id', false) ->where('contacts.id', '=', $contact_id) ->where('contact_permissions.client_id', '=', $contact->client_id) ->delete(['contacts.*', 'contact_numbers.*', 'contact_permissions.*', 'email_verifications.*']);
To
$this->Record->from('contacts') ->leftJoin('contact_numbers', 'contact_numbers.contact_id', '=', 'contacts.id', false) ->on('contact_permissions.client_id', '=', $contact->client_id) ->leftJoin('contact_permissions', 'contact_permissions.contact_id', '=', 'contacts.id', false) ->leftJoin('email_verifications', 'email_verifications.contact_id', '=', 'contacts.id', false) ->where('contacts.id', '=', $contact_id) ->delete(['contacts.*', 'contact_numbers.*', 'contact_permissions.*', 'email_verifications.*']);