From a3c08127f80cd570d11eb6c54b4e113c5c8883cc Mon Sep 17 00:00:00 2001 From: ProgrammGamer Date: Sun, 1 Feb 2026 19:26:18 +0100 Subject: [PATCH] Release 1.0 notes + fixes: remove kc_phasen query, init $debug_output; add CHANGELOG and link from README --- CHANGELOG.md | 16 ++++++++++++++++ README.md | 4 ++++ includes/admin-workshops.php | 5 +++-- includes/frontend-form.php | 10 ++-------- 4 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ef279da --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,16 @@ +# Changelog + +All notable changes to this project are documented in this file. + +## [1.0] - 2026-02-01 +### Added +- Initial release of the KonfiCastle Workshop-Wahlen plugin (Admin backend, participant frontend, assignment logic, CSV export, teamer password management). +- Shortcodes: `[konficastle_workshopwahl wahl=ID]`, `[konficastle_workshop_ergebnis wahl=ID]`. + +### Fixed +- Removed query against non-existent table `kc_phasen`; phases are derived from `kc_wahlen.anzahl_einheiten`. See [includes/admin-workshops.php](includes/admin-workshops.php). +- Initialized `$debug_output` to prevent PHP warning in frontend. See [includes/frontend-form.php](includes/frontend-form.php). + +### Notes +- Database tables use WordPress prefix via `$wpdb->prefix`. +- Force assignments have priority over automatic allocation. diff --git a/README.md b/README.md index 157bba0..dad92b6 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,7 @@ Dieses WordPress-Plugin ermöglicht die Verwaltung und Durchführung von Worksho Für Detailfragen zu Datenbankstruktur, Shortcodes oder Zuteilungslogik siehe die jeweiligen Dateien im `includes/`-Verzeichnis. +## Release Notes + +Siehe die ausführlichen Hinweise zur Version 1.0 in [RELEASE_NOTES.md](RELEASE_NOTES.md). + diff --git a/includes/admin-workshops.php b/includes/admin-workshops.php index a03c672..d06296f 100644 --- a/includes/admin-workshops.php +++ b/includes/admin-workshops.php @@ -10,8 +10,9 @@ function kc_workshops_page() { // Liste aller Wahlen für Auswahl $wahlen_liste = $wpdb->get_results("SELECT * FROM {$prefix}kc_wahlen ORDER BY id DESC"); - // Liste aller Phasen für Auswahl - $phasen_liste = $wpdb->get_results("SELECT * FROM {$prefix}kc_phasen ORDER BY nummer"); + // Phasen werden pro Wahl über die Spalte `anzahl_einheiten` in `kc_wahlen` bestimmt. + // Eine separate Tabelle `kc_phasen` wird nicht benötigt. + $phasen_liste = []; // Workshop löschen if (isset($_GET['delete_workshop'])) { diff --git a/includes/frontend-form.php b/includes/frontend-form.php index d0be839..a706958 100644 --- a/includes/frontend-form.php +++ b/includes/frontend-form.php @@ -5,14 +5,8 @@ add_shortcode('konficastle_workshopwahl', function($atts) { global $wpdb; - // KRITISCHER TEST: Ausgabe ganz am Anfang - //$debug_output = '
'; - //$debug_output .= '

DEBUG INFO

'; - //$debug_output .= 'Shortcode läuft!
'; - //$debug_output .= 'REQUEST_METHOD: ' . ($_SERVER['REQUEST_METHOD'] ?? 'NICHT GESETZT') . '
'; - //$debug_output .= 'POST vorhanden: ' . (empty($_POST) ? 'NEIN' : 'JA') . '
'; - //$debug_output .= 'POST Inhalt:
' . print_r($_POST, true) . '
'; - //$debug_output .= '
'; + // Optionales Debug-Ausgabe-Fragment (standardmäßig leer, um Warnungen zu vermeiden) + $debug_output = ''; $wahl = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->prefix}kc_wahlen WHERE id=%d", $wahl_id)); if(!$wahl || !$wahl->freigegeben) {