fix(import): set is_published=1 and map access_type_id on CSV import

Imported theses were invisible on the public site because:
1. is_published defaulted to 0 (schema default) — the INSERT never
   set it, so all imported rows stayed unpublished and were filtered
   out by v_theses_public (WHERE is_published = 1) and every public
   DB method.
2. The access column (CSV col 16 'Autorisation') was read into $access
   but never written to access_type_id — silently dropped.

Fix: INSERT now includes is_published = 1 and access_type_id (resolved
from access_types.name via ucfirst/strtolower normalisation, defaulting
to 1/Libre when the CSV cell is empty or unrecognised).
This commit is contained in:
Pontoporeia
2026-03-31 16:37:14 +02:00
parent 72d48c49c3
commit 877e322568
2 changed files with 19 additions and 2 deletions

View File

@@ -5,3 +5,4 @@
- [x] Auto-migrate both test.db and posterg.db on `just serve` via scripts/migrate.sh
- [x] Fix wrong `require_once` depth in `public/admin/actions/page.php` (`../../``../../../`)
- [x] Fix same path depth bug in `formulaire.php` and `publish.php`
- [x] Fix CSV import: imported theses not visible on public site (is_published defaulted to 0, access_type_id never set)