From 75645d17ccdc277e0bf3aff4ec18df417878f709 Mon Sep 17 00:00:00 2001 From: creme332 <65414576+creme332@users.noreply.github.com> Date: Thu, 16 May 2024 16:24:06 +0400 Subject: [PATCH] init `form_submitted`, call appropriate method from Error controller --- src/controllers/Register.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/Register.php b/src/controllers/Register.php index 56562c96..95d86fdc 100644 --- a/src/controllers/Register.php +++ b/src/controllers/Register.php @@ -33,6 +33,7 @@ public function __construct() $this->view_data['defaultConfirmPassword'] = ""; $this->view_data['errors'] = []; $this->view_data['editMode'] = false; + $this->view_data['form_submitted'] = false; // get list of districts to be displayed on form $this->view_data['districts'] = District::getAll(); @@ -72,6 +73,7 @@ public function getFormData(): array private function handleFormSubmission(): void { + $this->view_data['form_submitted'] = true; $form_data = $this->getFormData(); // create a new client object @@ -115,7 +117,7 @@ private function handleFormSubmission(): void Utility::redirect('login'); } - (new Error())->index("An error occurred while processing your registration. Please try again later."); + (new Error())->handleUnknownError(); die(); } else { $this->loadDataToForm($form_data); @@ -148,7 +150,7 @@ private function validateURL(): bool private function handleInvalidURL(): void { if (!$this->validateURL()) { - (new Error())->index("Page not found"); + (new Error())->handlePageNotFoundError(); die(); } }