individui e gruppi
This commit is contained in:
@@ -25,6 +25,7 @@ App gestionale Laravel 13 con AdminLTE 4 per gestione Persone e Gruppi.
|
||||
- **2026-06-10**: Per-User Column Views, ColumnManager JS, editVista data-* fix, 405 AJAX fix
|
||||
- **2026-06-17**: Google OAuth 2.0 unificato (revert Socialite, unified OAuth per Email/Drive/Calendar, XOAUTH2 SMTP+IMAP, UI impostazioni)
|
||||
- **2026-06-17**: Fix CalendarioConnessione — `encryptAndSetConfig()` perdeva campi sensibili in edit, `is_active` checkbox senza hidden fallback, query duplicata nella view
|
||||
- **2026-06-18**: Fix import CSV — `declare(strict_types=1)` mancante in IndividuoController, header check assente, Log::warning() su errori; fix freeze server (set_time_limit, session_write_close, DB::transaction, fgetcsv length illimitato) in GruppoController e IndividuoController
|
||||
|
||||
## Funzionalità Implementate
|
||||
|
||||
@@ -665,3 +666,42 @@ Aggiunto `if (!Schema::hasTable('table_name')) { ... }` wrapper a 28 migration f
|
||||
- PHP lint: OK su controller + routes
|
||||
- JS brace balance: OK su index view
|
||||
- Route list: `POST mailing-liste/mass-tag` → `MailingListController@massTag` (name: `mailing-liste.mass-tag`)
|
||||
|
||||
## 2026-06-18 — Fix import CSV: freeze server + bug IndividuoController
|
||||
|
||||
### Problema freeze server (Gruppi + Individui)
|
||||
Importando CSV con molte righe, il server si bloccava:
|
||||
1. **PHP max_execution_time (30s)** — killava il processo su import grandi
|
||||
2. **Session lock** — altre richieste dello stesso utente restavano in attesa
|
||||
3. **Nessuna transazione DB** — ogni `create()` era una INSERT individuale autocommit
|
||||
4. **fgetcsv length=1000** — righe CSV più lunghe di 1000 caratteri venivano troncate
|
||||
|
||||
### Fix applicati a `GruppoController@importStore` e `IndividuoController@importStore`
|
||||
```php
|
||||
set_time_limit(0);
|
||||
session_write_close();
|
||||
$header = fgetcsv($handle, 0, ','); // length=0 = nessun limite
|
||||
DB::beginTransaction();
|
||||
// ... loop ...
|
||||
DB::commit();
|
||||
```
|
||||
|
||||
### Bug trovati in `IndividuoController@importStore`
|
||||
| Bug | Fix |
|
||||
|-----|-----|
|
||||
| `declare(strict_types=1)` mancante | ✅ Aggiunto |
|
||||
| Indentazione errata negli import (spazi extra su 8 righe) | ✅ Corretto |
|
||||
| `use Illuminate\Support\Facades\Log` mancante | ✅ Aggiunto |
|
||||
| Nessun controllo `$header === false` — CSV vuoto causava TypeError | ✅ Aggiunto |
|
||||
| Nessun `array_map('trim', $header)` | ✅ Aggiunto |
|
||||
| Nessun `Log::warning()` su eccezioni riga | ✅ Aggiunto |
|
||||
| `fgetcsv` length=1000 (vs 0) | ✅ Portato a 0 |
|
||||
| Nessun `set_time_limit(0)` / `session_write_close()` | ✅ Aggiunto |
|
||||
| Nessun `DB::beginTransaction()` / `DB::commit()` | ✅ Aggiunto |
|
||||
|
||||
### File modificati
|
||||
- `app/Http/Controllers/GruppoController.php` — aggiunti `use DB`, set_time_limit, session_write_close, fgetcsv length=0, DB::transaction
|
||||
- `app/Http/Controllers/IndividuoController.php` — strict_types, Log import, DB import, header check, trim, set_time_limit, session_write_close, DB::transaction
|
||||
|
||||
### Verifica
|
||||
- `php -l` su entrambi: nessun errore di sintassi
|
||||
|
||||
Reference in New Issue
Block a user