1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-07 13:22:15 +01:00

Fix importazione anagrafiche

This commit is contained in:
valentina 2024-09-09 12:25:31 +02:00
parent b3e6ceb47d
commit 6aee72c4dd

View File

@ -74,11 +74,13 @@ class Upload extends Model
$model = new static();
// Informazioni di base
$name = $data['name'] ?? $name;
$name ??= basename($source);
$original_name = basename($source) ?? $name;
$category = $data['category'] ?? $category;
if (empty($name)) {
$name = $data['name'] ?? ($source['name'] ?? $source);
}
$original_name = $source['name'] ?? $name;
$category = $data['category'] ?? $category;
// Nome e categoria dell'allegato
$model->name = !empty($name) ? $name : $original_name;
$model->category = $category;