diff --git a/homepage/participo/api.starter.remove.php b/homepage/participo/api.starter.remove.php index bc6130a..6087eae 100644 --- a/homepage/participo/api.starter.remove.php +++ b/homepage/participo/api.starter.remove.php @@ -16,12 +16,10 @@ dbConnector::connect( participo::authentificate(); -$eventId = $_POST['eventId'] ?? null; -$starterId = $_POST['userId'] ?? null; - +$starterId = $_POST['starterId'] ?? null; $returnToUrl = $_POST['returnToUrl'] ?? 'participo/'; -$starter = new Starter(null, $eventId, null, $starterId); +$starter = Starter::loadFromDb($starterId); $starter->removeFromDb(); header('Location: ' . urldecode($returnToUrl), true, 301); diff --git a/homepage/participo/lib/participoLib/dbConnector.php b/homepage/participo/lib/participoLib/dbConnector.php index 1c3bb2e..63bfe9c 100644 --- a/homepage/participo/lib/participoLib/dbConnector.php +++ b/homepage/participo/lib/participoLib/dbConnector.php @@ -38,6 +38,8 @@ class dbConnector if (empty($someOptions['dontFetch'])) { $someOptions['dontFetch'] = false; } + + $ignoreErrors = $someOptions['ignoreErrors'] ?? false; /// @toDo: Bisher wird nur die Rückgabe konvertiert. Eigentlich muss /// doch auch die Eingabe konvertiert werden. Aber das jetzt @@ -63,7 +65,7 @@ class dbConnector ); } $pdoResult = $pdoStatement->execute(); - if (!$pdoResult) { + if (!$ignoreErrors && !$pdoResult) { echo("Error during dbQuery!\n"); echo("DB-Error:\n"); var_dump(self::$db->errorInfo()); diff --git a/homepage/participo/lib/participoLib/event.php b/homepage/participo/lib/participoLib/event.php index 5c2cb5a..dfa52a2 100644 --- a/homepage/participo/lib/participoLib/event.php +++ b/homepage/participo/lib/participoLib/event.php @@ -150,7 +150,7 @@ class Event $kids = participo::getKids(); $modal .= '