Fix upload template

This commit is contained in:
Pek5892 2024-04-05 16:07:27 +02:00
parent cd80a18bca
commit 00baaa0788
1 changed files with 4 additions and 3 deletions

View File

@ -115,6 +115,7 @@ if (file_exists($extraction_dir.'/VERSION')) {
// Informazioni aggiuntive per il database // Informazioni aggiuntive per il database
$insert = []; $insert = [];
$insert_lang = [];
// Plugin // Plugin
if (basename($file->getRealPath()) == 'PLUGIN') { if (basename($file->getRealPath()) == 'PLUGIN') {
@ -135,7 +136,7 @@ if (file_exists($extraction_dir.'/VERSION')) {
$installed = Prints::getPrints()[$info['name']]; $installed = Prints::getPrints()[$info['name']];
$insert['id_module'] = (new Module())->getByField('name', $info['module']); $insert['id_module'] = (new Module())->getByField('name', $info['module']);
$insert['is_record'] = $info['is_record']; $insert['is_record'] = $info['is_record'];
$insert['filename'] = $info['filename']; $insert_lang['filename'] = $info['filename'];
$insert['icon'] = $info['icon']; $insert['icon'] = $info['icon'];
} }
@ -154,12 +155,12 @@ if (file_exists($extraction_dir.'/VERSION')) {
'enabled' => 1, 'enabled' => 1,
])); ]));
$id_record = $dbo->lastInsertedID(); $id_record = $dbo->lastInsertedID();
$dbo->insert($table.'_lang', [ $dbo->insert($table.'_lang', array_merge($insert_lang, [
'name' => $info['name'], 'name' => $info['name'],
'title' => !empty($info['title']) ? $info['title'] : $info['name'], 'title' => !empty($info['title']) ? $info['title'] : $info['name'],
'id_record' => $id_record, 'id_record' => $id_record,
'id_lang' => Models\Locale::getDefault()->id, 'id_lang' => Models\Locale::getDefault()->id,
]); ]));
flash()->error(tr('Installazione completata!')); flash()->error(tr('Installazione completata!'));
} else { } else {
flash()->error(tr('Aggiornamento completato!')); flash()->error(tr('Aggiornamento completato!'));