Files
Jürgen Mummert db7094fd1e Fix frontend CSRF, clean reader URLs, and review findings
CSRF / actions:
- List action forms now send both REQUEST_TOKEN (Contao gate) and _token
  (Symfony, validated via isCsrfTokenValid) — mirrors the editor; fixes
  the 400/500 "Ungültiger CSRF-Token" on publish/toggle/duplicate/delete

Public reader / URLs:
- Reader & results read auto_item via Input::get (marks the route param used)
  so clean path URLs /<page>/<alias> no longer 404
- List controller generates path URLs via ['parameters' => '/'.$alias]
- Allow re-participation in the same session after a 60s cooldown

Review fixes:
- Results: merge answer snapshots by questionId+type (no more split cards on
  label edits); seed "Vielleicht" when allowMaybe so screen matches Excel
- Reader: replace generic answer hint with per-option "weiter zu Frage X"
  only when a jump is configured; strip HTML tags from survey description
- PDF: render free-text frequency summary; drop duplicate "Minimum" label
- Drag-sort: bundle SortableJS locally, drop the duplicated inline sort CSS/JS
  from _survey_assets, throttle the backend MutationObserver
- Backend: move hardcoded tl_survey operation labels to TL_LANG (de+en)
- Remove dead code: SurveyEditorVoter, SurveyPermissionService,
  categoryFilter/categorySummary + helpers, orphaned publishSurvey lang key

Reader layout:
- max-width 1000px (other views keep 1400px); back/next buttons fill the
  width as equal, card-sized halves; sort handle icon offset tweak

Docs: update AI_HANDOVER (dual-token CSRF, clean URLs) and README

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 13:00:05 +02:00

33 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Survey Bundle
Proprietäres Contao-5.7-Bundle für ein Umfrage-System.
Das Bundle stellt Frontend- und Backend-Funktionen für die Erstellung, Verwaltung, Veröffentlichung und Auswertung von Umfragen bereit. Dazu gehören insbesondere öffentliche Umfrageaufrufe über Link-Schlüssel, Redaktions- und Zuordnungslogik für Mitglieder, Ergebnisdarstellungen im Frontend sowie Exportfunktionen für Excel und PDF.
Ziel des Bundles ist eine möglichst native Integration in Contao, sodass Umfragen sich wie ein regulärer Bestandteil der bestehenden System- und Redaktionsumgebung verhalten.
## Dokumentation
Architektur, Zustandslogik, bewusste Produktentscheidungen und Einstiegspunkte sind ausführlich in [`AI_HANDOVER.md`](AI_HANDOVER.md) beschrieben.
Zwei wiederkehrend relevante technische Konventionen:
- **CSRF in Frontend-Aktionsformularen:** Jedes POST-Formular sendet **zwei** Tokens `REQUEST_TOKEN` (Contaos globaler Frontend-Gate) und `_token` (`csrf_token('<aktion>-' ~ id)`, im Controller via `isCsrfTokenValid` geprüft). Beide sind nötig.
- **Saubere Link-URLs:** Reader und Ergebnisseite werden als Pfad adressiert (`/<seite>/<alias>`). Erzeugung über `['parameters' => '/'.$alias]`, Auslesen über `Input::get('auto_item')` (markiert den Route-Parameter als benutzt sonst Contao-404).
Nach Änderungen an DCA, Backend-CSS oder JS:
```bash
php vendor/bin/contao-console assets:install public --symlink --relative
php vendor/bin/contao-console cache:clear --env=prod
```
## Rechtlicher Hinweis
Dieses Bundle ist proprietär und nicht zur öffentlichen Weitergabe bestimmt.
Copyright (c) Mummert Media. Alle Rechte vorbehalten.
Die Nutzung, Vervielfältigung, Veränderung, Veröffentlichung oder Weitergabe ist ausschließlich im Rahmen der ausdrücklich von Mummert freigegebenen internen oder vertraglich geregelten Verwendung zulässig. Eine Nutzung durch Dritte ohne vorherige schriftliche Zustimmung ist nicht gestattet.
Es wird keine Open-Source-Lizenz für dieses Bundle eingeräumt.