Jump to content

Contact edit page email_verification error


CY.

Recommended Posts

Hello,

Email verification has a problem on client side. If you open contact edit page for a special contact, it generates an error. Special contact does not have any record on email_verifications table. These contacts can be created when you upgraded to newest Blesta version(in our case).  If you decided to disable email verification then enable again, special contacts can be created because created contacts does not have any email_verifications record . ClientContacts controller gets $email_verification variable as false then Blesta try to access contact_id property of "false" variable. 

// Check if the email address has been verified
$this->uses(['EmailVerifications']);
$email_verification = $this->EmailVerifications->getByContactId($contact->id);

$time = time();
$hash = $this->Clients->systemHash('c=' . $email_verification->contact_id . '|t=' . $time);
$message = Language::_(
    'ClientContacts.!info.unverified_email',
    true,
    $email_verification->email
);
$options = [
    'info_buttons' => [
        [
            'url' => $this->base_uri . 'verify/send/?sid=' . rawurlencode(
                    $this->Clients->systemEncrypt(
                        'c=' . $email_verification->contact_id . '|t=' . $time . '|h=' . substr($hash, -16)
                    )
                ),
            'label' => Language::_('ClientContacts.!info.unverified_email_button', true),
            'icon_class' => 'fa-share'
        ]
    ]
];

 

$email_verification->contact_id should be $contact->id and that verify button part should be visible only email verification is enabled.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...