Improve pen list handling

This commit is contained in:
José González 2021-07-02 16:39:59 +02:00
parent 159920a05d
commit d219e004df
1 changed files with 5 additions and 2 deletions

View File

@ -837,8 +837,11 @@ class ModuleTemplates extends HTML
$penInfo = db_get_all_rows_filter('tnetwork_profile_pen', ['id_np' => $this->id_np]);
$penList = [];
foreach ($penInfo as $pen) {
$penList[] = $pen['pen'];
// Handle if list of PEN does not exist or is empty.
if ($penInfo !== false) {
foreach ($penInfo as $pen) {
$penList[] = $pen['pen'];
}
}
$this->pen = implode(',', $penList);