Skip to content

Commit

Permalink
chore: disable problematic hook (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
fox-john authored Dec 5, 2024
1 parent 142b281 commit 2b977d6
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions ps_eventbus.php
Original file line number Diff line number Diff line change
Expand Up @@ -1644,34 +1644,34 @@ public function hookActionObjectEmployeeUpdateAfter()
*/
public function hookActionDispatcherBefore($parameters)
{
/** @var SynchronizationService $synchronizationService * */
$synchronizationService = $this->getService('PrestaShop\Module\PsEventbus\Service\SynchronizationService');

try {
/*
* Class "ActionDispatcherLegacyHooksSubscriber" as implement in 1.7.3.0:
* https://github.com/PrestaShop/PrestaShop/commit/a4ae4544cc62c818aba8b3d9254308f538b7acdc
*/
if ($parameters['controller_type'] != 2) {
return;
}

if (array_key_exists('route', $parameters)) {
$route = $parameters['route'];

// when translation is edited or reset, add to incremental sync
if ($route == 'api_translation_value_edit' || $route == 'api_translation_value_reset') {
$synchronizationService->insertIncrementalSyncObject(
0,
Config::COLLECTION_TRANSLATIONS,
date(DATE_ATOM),
$this->shopId
);
}
}
} catch (Exception $e) {
return;
}
// /** @var SynchronizationService $synchronizationService * */
// $synchronizationService = $this->getService('PrestaShop\Module\PsEventbus\Service\SynchronizationService');
//
// try {
// /*
// * Class "ActionDispatcherLegacyHooksSubscriber" as implement in 1.7.3.0:
// * https://github.com/PrestaShop/PrestaShop/commit/a4ae4544cc62c818aba8b3d9254308f538b7acdc
// */
// if ($parameters['controller_type'] != 2) {
// return;
// }
//
// if (array_key_exists('route', $parameters)) {
// $route = $parameters['route'];
//
// // when translation is edited or reset, add to incremental sync
// if ($route == 'api_translation_value_edit' || $route == 'api_translation_value_reset') {
// $synchronizationService->insertIncrementalSyncObject(
// 0,
// Config::COLLECTION_TRANSLATIONS,
// date(DATE_ATOM),
// $this->shopId
// );
// }
// }
// } catch (Exception $e) {
// return;
// }
}

/**
Expand Down

0 comments on commit 2b977d6

Please sign in to comment.