Skip to content

Commit 6df33c9

Browse files
committed
fix: aggiunta attributo
1 parent a3c2c68 commit 6df33c9

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

modules/attributi_combinazioni/actions.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@
2525

2626
switch (filter('op')) {
2727
case 'add':
28-
$descrizione = post('nome');
2928
$title = post('titolo');
30-
$attributo_new = (new Attributo())->getByField('title', $descrizione);
29+
$attributo_new = (new Attributo())->getByField('title', $title);
3130

32-
if ($stato_new) {
31+
if ($attributo_new) {
3332
flash()->error(tr('Questo nome è già stato utilizzato per un altro attributo.'));
3433
} else {
3534
$attributo = Attributo::build();
3635
$id_record = $dbo->lastInsertedID();
37-
$attributo->setTranslation('title', $descrizione);
3836
$attributo->setTranslation('title', $title);
39-
$attributo->save();
4037

4138
flash()->info(tr('Nuovo attributo creato correttamente!'));
4239
}

0 commit comments

Comments
 (0)