Skip to content

Commit efdc504

Browse files
authored
Merge pull request #162 from PrestaShop/dev
Release 5.0.1
2 parents 9f18ece + 3406505 commit efdc504

6 files changed

Lines changed: 15 additions & 8 deletions

File tree

classes/Hook/HookActionValidateOrder.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ public function __construct(Ps_Googleanalytics $module, Context $context)
5353
*/
5454
public function run()
5555
{
56-
// Check if we are creating backoffice order
57-
if ($this->context->controller->controller_name != 'AdminOrders' && $this->context->controller->controller_name != 'Admin') {
56+
// Check if we are creating backoffice order, we are only launching this hook when creating backoffice order
57+
// For FO purposes, we use displayOrderConfirmation.
58+
if (empty($this->context->controller->controller_name)
59+
|| !in_array($this->context->controller->controller_name, ['AdminOrders', 'Admin'])) {
5860
return;
5961
}
6062

config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<module>
33
<name>ps_googleanalytics</name>
44
<displayName><![CDATA[Google Analytics]]></displayName>
5-
<version><![CDATA[5.0.0]]></version>
5+
<version><![CDATA[5.0.1]]></version>
66
<description><![CDATA[Gain clear insights into important metrics about your customers, using Google Analytics]]></description>
77
<author><![CDATA[PrestaShop]]></author>
88
<tab><![CDATA[analytics_stats]]></tab>

controllers/admin/AdminGanalyticsAjax.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ public function init()
3131

3232
if (Validate::isLoadedObject($order) && (isset($this->context->employee->id) && $this->context->employee->id)) {
3333
(new GanalyticsRepository())->markOrderAsSent((int) $orderId);
34-
$this->ajaxDie('OK');
34+
$this->ajaxRender('OK');
35+
exit;
3536
}
3637

37-
$this->ajaxDie('KO');
38+
$this->ajaxRender('KO');
39+
exit;
3840
}
3941
}

controllers/front/ajax.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ public function initContent()
3535
$order = new Order($orderId);
3636

3737
if (!Validate::isLoadedObject($order) || $order->id_customer != (int) Tools::getValue('customer')) {
38-
$this->ajaxDie('KO');
38+
$this->ajaxRender('KO');
39+
exit;
3940
}
4041

4142
(new GanalyticsRepository())->markOrderAsSent((int) $orderId);
4243

43-
$this->ajaxDie('OK');
44+
$this->ajaxRender('OK');
45+
exit;
4446
}
4547
}

ps_googleanalytics.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct()
4747
{
4848
$this->name = 'ps_googleanalytics';
4949
$this->tab = 'analytics_stats';
50-
$this->version = '5.0.0';
50+
$this->version = '5.0.1';
5151
$this->ps_versions_compliancy = ['min' => '1.7.7', 'max' => _PS_VERSION_];
5252
$this->author = 'PrestaShop';
5353
$this->module_key = 'fd2aaefea84ac1bb512e6f1878d990b8';

tests/phpstan/phpstan-1.7.7.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ parameters:
66
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'
77
- '#Access to an undefined property Cookie\:\:\$ga_admin_order.#'
88
- '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#'
9+
- '#Parameter \#1 \$value of method ControllerCore::ajaxRender\(\) expects null, string given.#'

0 commit comments

Comments
 (0)