Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-4960

Unable to delete contact that has no permissions

    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.*']);
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              19/Oct/23

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 7 minutes
              7m

                Agile