Files
xamxam/TODO.md
Pontoporeia 4986fa74f4 add structured logging for admin/partage form submissions + migration system
- AppLogger: JSON-line logger in storage/logs/form-submissions.log
- Logs submissions (admin + partage) with IP, UA, thesis ID, author
- Logs errors with context (post keys, share slug)
- Migration runner (app/migrations/run.php) handles schema drift
- 001_add_objet_column.sql fixes production DB missing 'objet' column
- ThesisCreateController::getIdentifier() helper for logging
2026-04-24 23:03:49 +02:00

1.8 KiB

Posterg TODO

Fixes

  • Replace mb_strtolower with strtolower in admin/index.php (mbstring not available in php8.4-fpm)
  • Replace mb_strlen/mb_substr with strlen/substr in student-preview.php (same root cause)
  • Add objet column migration (production DB missing column → SQLSTATE[HY000]: table theses has no column named objet)

Logging

  • AppLogger — structured JSON logger at storage/logs/form-submissions.log
  • Admin formulaire: log submissions (success + error, IP, UA, author, post keys)
  • Partage form: log submissions (success + error, share slug, IP, UA, post keys)

Migrations

  • Migration runner (app/migrations/run.php) with tracking table _migrations
  • 001_add_objet_column.sql (handles duplicate-column gracefully)

Features

  • Student name popover preview in /repertoire (zero per-hover requests)
    • Database::getThesesByAuthorName() query
    • SearchController::handleStudentPreview() HTMX endpoint
    • /repertoire/student-preview route in Dispatcher
    • partials/student-preview.php — iframe (single) or link list (multiple)
    • Updated repertoire-index.php — htmx hover attrs, $studentWorks map
    • Popover container + JS position/hide logic in repertoire.php
    • CSS in repertoire.css

File naming

  • Analyse current file saving in admin/add.php and partage/index.php
  • Implement author slug generation (generateAuthorSlug)
  • Modify handleThesisFiles: folder = theses/{year}/{year}_{AUTHOR_NAME}/
  • Modify handleThesisFiles: filename = AUTHOR_NAME_sanitized_original.ext
  • Ensure uniqueness within same year/author (suffix _1, _2, etc.)
  • Database path storage updated automatically via insertThesisFile
  • Test with actual uploads
  • Consider same changes for handleCoverUpload and handleBannerUpload