Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 5.13.2
-
Fix Version/s: 5.13.3
-
Component/s: Client Interface
-
Labels:None
Description
When a client visits their "Manage Account" link it shows a white page with "Contact Information" and a Profile Picture option. The following error is written to logs:
==> general-error-2026-01-31.log <==
[2026-01-31T00:28:47.885214+00:00] general.ERROR: Uncaught Exception TypeError: "in_array(): Argument #2 ($haystack) must be of type array, false given" at /home/user/public_html/app/views/client/bootstrap/client_contacts_contact_info.pdt line 45
Similar fix for
- Adding Contacts. Contacts : Add.
- Edit Contact
- Make payment > Enter new Payment details (Was not able to reproduce this one though for client_pay.php)
Fix
Edit /app/controllers/client_contacts.php
Replace (around line 466):
// Get contact field groups
foreach ($contact_fields_groups as $group_name) {
if ($this->client) {
${$group_name} = $this->ClientGroups->getSetting($this->client->client_group_id, $group_name);
if (${$group_name}) {
${$group_name} = unserialize(base64_decode(${$group_name}->value));
}
}
$contact_info[$group_name] = ${$group_name} ?? [];
}
With:
// Get contact field groups
foreach ($contact_fields_groups as $group_name) {
${$group_name} = [];
if ($this->client) {
$setting = $this->ClientGroups->getSetting($this->client->client_group_id, $group_name);
if ($setting) {
$unserialized = \Blesta\Core\Util\Common\Classes\Model::safeUnserialize(
base64_decode($setting->value)
);
if (is_array($unserialized)) {
${$group_name} = $unserialized;
}
}
}
Edit /app/controllers/client_main.php
Replace (around line 733):
foreach ($contact_fields_groups as $group_name) {
if ($this->client) {
${$group_name} = $this->ClientGroups->getSetting($this->client->client_group_id, $group_name);
if (${$group_name}) {
${$group_name} = unserialize(base64_decode(${$group_name}->value));
}
}
$contact_info[$group_name] = ${$group_name} ?? [];
}
With:
foreach ($contact_fields_groups as $group_name) {
${$group_name} = [];
if ($this->client) {
$setting = $this->ClientGroups->getSetting($this->client->client_group_id, $group_name);
if ($setting) {
$unserialized = \Blesta\Core\Util\Common\Classes\Model::safeUnserialize(
base64_decode($setting->value)
);
if (is_array($unserialized)) {
${$group_name} = $unserialized;
}
}
}
$contact_info[$group_name] = ${$group_name};
}
Edit /app/controllers/client_payphp
Replace (around line 1392):
// Get contact field groups
foreach ($contact_fields_groups as $group_name) {
if ($this->client) {
${$group_name} = $this->ClientGroups->getSetting($this->client->client_group_id, $group_name);
if (${$group_name}) {
${$group_name} = unserialize(base64_decode(${$group_name}->value));
}
}
$contact_info[$group_name] = ${$group_name} ?? [];
With:
// Get contact field groups
foreach ($contact_fields_groups as $group_name) {
${$group_name} = [];
if ($this->client) {
$setting = $this->ClientGroups->getSetting($this->client->client_group_id, $group_name);
if ($setting) {
$unserialized = unserialize(base64_decode($setting->value));
if (is_array($unserialized)) {
${$group_name} = $unserialized;
}
}
}
$contact_info[$group_name] = ${$group_name};
For the Order plugin
Edit plugins/order/controllers/signup.php (around line 278).
Replace:
// Get required contact fields
$required_contact_fields = $this->ClientGroups->getSetting(
$this->client->client_group_id ?? $this->order_form->client_group_id,
'required_contact_fields'
);
if ($required_contact_fields) {
$required_contact_fields = unserialize(base64_decode($required_contact_fields->value));
}
// Get shown contact fields
$shown_contact_fields = $this->ClientGroups->getSetting(
$this->client->client_group_id ?? $this->order_form->client_group_id,
'shown_contact_fields'
);
if ($shown_contact_fields) {
$shown_contact_fields = unserialize(base64_decode($shown_contact_fields->value));
with:
// Get required contact fields
$required_contact_fields = [];
$setting = $this->ClientGroups->getSetting(
$this->client->client_group_id ?? $this->order_form->client_group_id,
'required_contact_fields'
);
if ($setting) {
$unserialized = unserialize(base64_decode($setting->value));
if (is_array($unserialized)) {
$required_contact_fields = $unserialized;
}
}
// Get shown contact fields
$shown_contact_fields = [];
$setting = $this->ClientGroups->getSetting(
$this->client->client_group_id ?? $this->order_form->client_group_id,
'shown_contact_fields'
);
if ($setting) {
$unserialized = unserialize(base64_decode($setting->value));
if (is_array($unserialized)) {
$shown_contact_fields = $unserialized;
}
Around line 324:
Replace:
$this->set('required_contact_fields', ($required_contact_fields ?? ''));
$this->set('shown_contact_fields', ($shown_contact_fields ?? ''));
With:
$this->set('required_contact_fields', $required_contact_fields);
$this->set('shown_contact_fields', $shown_contact_fields);
Around line: 285
Replace:
$unserialized = unserialize(base64_decode($setting->value));
with:
$unserialized = \Blesta\Core\Util\Common\Classes\Model::safeUnserialize(
base64_decode($setting->value)
);
Replace Around line 299:
$unserialized = unserialize(base64_decode($setting->value));
with:
unserialized = \Blesta\Core\Util\Common\Classes\Model::safeUnserialize(
base64_decode($setting->value)
);