From f922f401635434c60b6505620ee19005cb807998 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bidegain Date: Tue, 28 May 2024 15:34:05 +0200 Subject: [PATCH 1/4] stop contact form process if there's an error in the controller --- contactform.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/contactform.php b/contactform.php index 2740ed3..dce53ec 100644 --- a/contactform.php +++ b/contactform.php @@ -406,8 +406,6 @@ public function sendMessage() [], 'Shop.Notifications.Error' ); - - return; } if (empty($message)) { $this->context->controller->errors[] = $this->trans( @@ -415,8 +413,6 @@ public function sendMessage() [], 'Shop.Notifications.Error' ); - - return; } if (!Validate::isCleanHtml($message)) { $this->context->controller->errors[] = $this->trans( @@ -424,8 +420,6 @@ public function sendMessage() [], 'Shop.Notifications.Error' ); - - return; } $id_contact = (int) Tools::getValue('id_contact'); @@ -437,8 +431,6 @@ public function sendMessage() [], 'Modules.Contactform.Shop' ); - - return; } if (!empty($file_attachment['name']) && $file_attachment['error'] != 0) { @@ -447,8 +439,6 @@ public function sendMessage() [], 'Modules.Contactform.Shop' ); - - return; } if (!empty($file_attachment['name']) && !in_array(Tools::strtolower(Tools::substr($file_attachment['name'], -4)), $extension) && @@ -459,8 +449,6 @@ public function sendMessage() [], 'Modules.Contactform.Shop' ); - - return; } if ($url !== '' || empty($serverToken) @@ -473,7 +461,9 @@ public function sendMessage() 'Modules.Contactform.Shop' ); $this->createNewToken(); + } + if (!empty($this->context->controller->errors)) { return; } From 25e19edd314ef8c79c8ceb4569112428eddea716 Mon Sep 17 00:00:00 2001 From: Touxten Date: Sat, 23 Nov 2024 19:52:41 +0100 Subject: [PATCH 2/4] Change folder name --- views/templates/{hook => widget}/contactform.tpl | 0 views/templates/{hook => widget}/index.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename views/templates/{hook => widget}/contactform.tpl (100%) rename views/templates/{hook => widget}/index.php (100%) diff --git a/views/templates/hook/contactform.tpl b/views/templates/widget/contactform.tpl similarity index 100% rename from views/templates/hook/contactform.tpl rename to views/templates/widget/contactform.tpl diff --git a/views/templates/hook/index.php b/views/templates/widget/index.php similarity index 100% rename from views/templates/hook/index.php rename to views/templates/widget/index.php From 46ca855ae18495fc1806ed0535a2189e90ef8335 Mon Sep 17 00:00:00 2001 From: Touxten <156076965+Touxten@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:14:15 +0100 Subject: [PATCH 3/4] Bump Version --- config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.xml b/config.xml index 3aef71b..1d29563 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ contactform - + From 7ef4994892030ce389374c0ba4c9e878d5f30720 Mon Sep 17 00:00:00 2001 From: Touxten <156076965+Touxten@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:15:09 +0100 Subject: [PATCH 4/4] Bump Version --- contactform.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contactform.php b/contactform.php index dce53ec..8866693 100644 --- a/contactform.php +++ b/contactform.php @@ -54,7 +54,7 @@ public function __construct() $this->name = 'contactform'; $this->author = 'PrestaShop'; $this->tab = 'front_office_features'; - $this->version = '4.4.2'; + $this->version = '4.4.3'; $this->bootstrap = true; parent::__construct();