Skip to content

Commit 8eebadc

Browse files
committed
fix: aggiunta categoria
1 parent b3d422f commit 8eebadc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

modules/articoli/src/Categoria.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ class Categoria extends Model
3838

3939
protected static $parent_identifier = 'parent';
4040

41-
public static function build($colore = null)
41+
public static function build($colore = null, $nome = null)
4242
{
4343
$model = new static();
44+
$model->name = $nome;
4445
$model->colore = $colore;
4546
$model->save();
4647

modules/categorie/actions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
$link = Modules::link('Categorie', $categoria_new->id, $categoria_new->getTranslation('title'));
114114
flash()->error($message.': '.$link);
115115
} else {
116-
$categoria = Categoria::build($colore);
116+
$categoria = Categoria::build($colore, $nome);
117117
$id_record = $dbo->lastInsertedID();
118118
$categoria->parent = $id_original;
119119
$categoria->is_articolo = $is_articolo;

0 commit comments

Comments
 (0)