mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
fix: add help email, preserve file names on validation error, license fix
The share link (partage) form does not expose a license field and does not send access_type_id (defaults to 2/Interne). Server-side validation was unconditionally requiring a license for non-admin submissions, causing all share link submissions to fail. Now the license check is gated on adminMode=false AND accessTypeId=1 (Libre), matching the client-side HTMX fragment behaviour in licence-fragment.php. Also fixed a use-before-definition where accessTypeId was referenced before being assigned. Student form improvements: - Add xamxam@erg.be mailto link at top of form - On validation error, append "Si le problème persiste, envoyez un e-mail à xamxam@erg.be" to the flash message - Preserve uploaded file names across validation redirects: store in session (share_primed_files_<slug>), display as warning on form re-render so the student knows which files to re-select - License: only required for non-admin when access_type_id=1 (Libre), not for Interne (2) or Interdit (3). Fixes share link submissions failing with "Veuillez sélectionner une licence". Also fixed use-before-definition of accessTypeId.
This commit is contained in:
10
app/migrations/pending/027_drop_banner_path.sql
Normal file
10
app/migrations/pending/027_drop_banner_path.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
-- Migration 027: drop banner_path column from theses table.
|
||||
-- Banners were merged into covers in migration 016; the column has been
|
||||
-- vestigial since. This is safe to run even if the column is already absent.
|
||||
-- Safe to re-run: IF EXISTS makes it idempotent.
|
||||
|
||||
-- SQLite does not support DROP COLUMN directly in older versions;
|
||||
-- we use the ALTER TABLE … DROP COLUMN syntax (supported since SQLite 3.35.0).
|
||||
-- If this fails on an older SQLite, the column stays as-is (harmless).
|
||||
|
||||
ALTER TABLE theses DROP COLUMN banner_path;
|
||||
Reference in New Issue
Block a user