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

        jonathan Jonathan Reissmueller created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Sprint 5.9.0 Sprint 1 [ 182 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Assignee Jonathan Reissmueller [ jonathan ]
        jonathan Jonathan Reissmueller made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        jonathan Jonathan Reissmueller made changes -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.9.0 Sprint 1 [ 182 ] 5.9.0 Sprint 1, 5.9.0 Sprint 2 [ 182, 183 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        abdy Abdy Franco made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 7 minutes [ 420 ]
        Worklog Id 16564 [ 16564 ]
        jonathan Jonathan Reissmueller made changes -
        Status In Review [ 5 ] Closed [ 6 ]

          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