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

2FA doesn't work for custom contact types

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.4
    • Component/s: None
    • Labels:
      None

      Description

      To reproduce:

      • Visit Settings > Company > General > Contact Types and add a custom contact type
      • Visit an admin client profile page and click "Add Contact" to create a contact of the new type
        • Be sure to enable login
      • Login as the new contact
      • Try to enable 2FA for the account
      • Receive the validation error "Invalid contact type ID"

      To resolve, in app/models/contacts.php in the adjustInput() method, change:

                  $vars['contact_type'] = (isset($vars['contact_type']) ? $vars['contact_type'] : $old_contact->contact_type);
      

      To

                  $vars['contact_type'] = (isset($vars['contact_type']) ? $vars['contact_type'] : $old_contact->contact_type);
                  $vars['contact_type_id'] = (isset($vars['contact_type_id']) ? $vars['contact_type_id'] : $old_contact->contact_type_id);
      

        Activity

        jonathan Jonathan Reissmueller created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Sprint 5.1.0 Sprint 3 [ 127 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Description To reproduce:
        * Visit Settings > Company > General > Contact Types and add a custom contact type
        * Visit an admin client profile page and click "Add Contact" to create a contact of the new type
        ** Be sure to enable login
        * Login as the new contact
        * Try to enable 2FA for the account
        * Receive the validation error "Invalid contact type ID"

        To resolve, in app/models/contacts.php in the adjustInput() method, change:

        {code:java}
                    $vars['contact_type'] = $this->ifSet($vars['contact_type'], $old_contact->contact_type);
        {code}


        To

        {code:java}
                    $vars['contact_type'] = $this->ifSet($vars['contact_type'], $old_contact->contact_type);
                    $vars['contact_type_id'] = $this->ifSet($vars['contact_type_id'], $old_contact->contact_type_id);
        {code}
        To reproduce:
        * Visit Settings > Company > General > Contact Types and add a custom contact type
        * Visit an admin client profile page and click "Add Contact" to create a contact of the new type
        ** Be sure to enable login
        * Login as the new contact
        * Try to enable 2FA for the account
        * Receive the validation error "Invalid contact type ID"

        To resolve, in app/models/contacts.php in the adjustInput() method, change:

        {code:java}
                    $vars['contact_type'] = (isset($vars['contact_type']) ? $vars['contact_type'] : $old_contact->contact_type);
        {code}


        To

        {code:java}
                    $vars['contact_type'] = (isset($vars['contact_type']) ? $vars['contact_type'] : $old_contact->contact_type);
                    $vars['contact_type_id'] = (isset($vars['contact_type_id']) ? $vars['contact_type_id'] : $old_contact->contact_type_id);
        {code}
        jonathan Jonathan Reissmueller made changes -
        Summary 2FA doesn't work form custom contact types 2FA doesn't work for custom contact types
        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 -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 10 minutes [ 600 ]
        Worklog Id 14806 [ 14806 ]
        jonathan Jonathan Reissmueller made changes -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        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:
              5/Apr/21

              Time Tracking

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

                Agile