Skip to content

Commit 5f4b277

Browse files
committed
fix: script aggiornamento
1 parent 4d5eda7 commit 5f4b277

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

update/2_9_6.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
$database->insert('zz_files', [
2626
'id_module' => $id_module,
2727
'id_record' => $articolo['id'],
28-
'nome' => 'Immagine',
28+
'name' => 'Immagine',
2929
'filename' => $articolo['immagine'],
3030
'original' => $articolo['immagine'],
3131
'key' => 'cover',
@@ -51,6 +51,10 @@
5151
$interventi = $database->fetchArray('SELECT `id`, `firma_file`, `firma_nome`, `firma_data` FROM `in_interventi` WHERE `firma_file` IS NOT NULL');
5252

5353
foreach ($interventi as $intervento) {
54+
if (empty($intervento['firma_file'])) {
55+
continue;
56+
}
57+
5458
$data_firma = !empty($intervento['firma_data']) ? date('Y-m-d', strtotime((string) $intervento['firma_data'])) : date('Y-m-d');
5559
$key = 'signature_'.$intervento['firma_nome'].'_'.$data_firma;
5660
$file_exists = $database->selectOne('zz_files', ['id'], [
@@ -63,7 +67,7 @@
6367
$database->insert('zz_files', [
6468
'id_module' => $id_module,
6569
'id_record' => $intervento['id'],
66-
'nome' => 'Firma',
70+
'name' => $intervento['firma_file'],
6771
'filename' => $intervento['firma_file'],
6872
'original' => $intervento['firma_file'],
6973
'key' => $key,
@@ -93,7 +97,7 @@
9397
$database->insert('zz_files', [
9498
'id_module' => $id_module,
9599
'id_record' => $impianto['id'],
96-
'nome' => 'Immagine',
100+
'name' => 'Immagine',
97101
'filename' => $impianto['immagine'],
98102
'original' => $impianto['immagine'],
99103
'key' => 'cover',

0 commit comments

Comments
 (0)