Skip to content

Commit 24ed023

Browse files
authored
Merge pull request #158 from Hlavtox/remove-ajaxdie
Remove usage of deprecated method ajaxDie
2 parents d5ab0a8 + 08a4132 commit 24ed023

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

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
}

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)