From c63c94c1374ec2c91b10edf1c61df8de95940815 Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 19 Dec 2019 13:37:10 +0100 Subject: [PATCH] Fix creazione categorie in gestione documentale --- modules/categorie_documenti/src/Categoria.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/categorie_documenti/src/Categoria.php b/modules/categorie_documenti/src/Categoria.php index 79b325b9b..f1ea658b4 100644 --- a/modules/categorie_documenti/src/Categoria.php +++ b/modules/categorie_documenti/src/Categoria.php @@ -19,7 +19,13 @@ class Categoria extends Model $model->save(); $gruppi = database()->fetchArray('SELECT `id` FROM `zz_groups`'); - $model->syncPermessi($gruppi); + foreach($gruppi as $array) { + foreach($array as $k=>$v) { + $newArray[$k] = $v; + } + } + + $model->syncPermessi($newArray); return $model; } @@ -27,7 +33,7 @@ class Categoria extends Model public function syncPermessi(array $groups) { $groups[] = 1; - + $database = database(); $database->sync('do_permessi', ['id_categoria' => $this->id], [ 'id_gruppo' => $groups,