Skip to content

Commit

Permalink
Merge pull request #158 from Hlavtox/remove-ajaxdie
Browse files Browse the repository at this point in the history
Remove usage of deprecated method ajaxDie
  • Loading branch information
kpodemski authored Feb 25, 2024
2 parents d5ab0a8 + 08a4132 commit 24ed023
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions controllers/admin/AdminGanalyticsAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ public function init()

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

$this->ajaxDie('KO');
$this->ajaxRender('KO');
exit;
}
}
6 changes: 4 additions & 2 deletions controllers/front/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ public function initContent()
$order = new Order($orderId);

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

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

$this->ajaxDie('OK');
$this->ajaxRender('OK');
exit;
}
}
1 change: 1 addition & 0 deletions tests/phpstan/phpstan-1.7.7.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ parameters:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'
- '#Access to an undefined property Cookie\:\:\$ga_admin_order.#'
- '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#'
- '#Parameter \#1 \$value of method ControllerCore::ajaxRender\(\) expects null, string given.#'

0 comments on commit 24ed023

Please sign in to comment.