Skip to content

Commit

Permalink
Merge branch '8.1.x' into fix/32218-responsive-visual-issues-new-prod…
Browse files Browse the repository at this point in the history
…uct-page
  • Loading branch information
mattgoud committed Mar 28, 2024
2 parents f3a2dae + e234d66 commit 6d35420
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion admin-dev/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

$kernel = new AppKernel(_PS_ENV_, _PS_MODE_DEV_);
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
//Request::enableHttpMethodParameterOverride();
Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
Request::setTrustedProxies([], Request::HEADER_X_FORWARDED_ALL);

Expand Down
14 changes: 10 additions & 4 deletions admin-dev/themes/new-theme/js/pages/product/service/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ export const saveImageInformations = async (
data[`${formName}[apply_to_all_stores]`] = selectedFile.applyToAllStores;

return $.ajax(saveUrl, {
method: 'PATCH',
data,
method: 'POST',
data: {
...data,
_method: 'PATCH',
},
});
};

Expand Down Expand Up @@ -113,8 +116,11 @@ export const saveImagePosition = async (
data[`${formName}[shop_id]`] = shopId || 0;

return $.ajax(sortUrl, {
method: 'PATCH',
data,
method: 'POST',
data: {
...data,
_method: 'PATCH',
},
});
};

Expand Down
1 change: 1 addition & 0 deletions config/smarty.config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function smartyEscape($string, $esc_type = 'html', $char_set = null, $double_enc
// Native PHP functions
smartyRegisterFunction($smarty, 'modifier', 'addcslashes', 'addcslashes');
smartyRegisterFunction($smarty, 'modifier', 'addslashes', 'addslashes');
smartyRegisterFunction($smarty, 'modifier', 'array_slice', 'array_slice');
smartyRegisterFunction($smarty, 'modifier', 'date', 'date');
smartyRegisterFunction($smarty, 'modifier', 'explode', 'explode');
smartyRegisterFunction($smarty, 'modifier', 'floatval', 'floatval');
Expand Down
9 changes: 6 additions & 3 deletions src/Adapter/Order/CommandHandler/UpdateOrderStatusHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ public function handle(UpdateOrderStatusCommand $command)
$order = $this->getOrder($command->getOrderId());
$orderState = $this->getOrderStateObject($command->getNewOrderStatusId());

/*
* Try to load current order status. There may be cases when there is none, for example when something happens
* during order creation process. That's why we check for $currentOrderState validity.
*/
$currentOrderState = $order->getCurrentOrderState();

if ($currentOrderState->id == $orderState->id) {
if (!empty($currentOrderState) && $currentOrderState->id == $orderState->id) {
throw new OrderException('The order has already been assigned this status.');
}

Expand All @@ -69,10 +72,10 @@ public function handle(UpdateOrderStatusCommand $command)

$history->changeIdOrderState((int) $orderState->id, $order, $useExistingPayments);

$carrier = new Carrier($order->id_carrier, (int) $order->getAssociatedLanguage()->getId());
$templateVars = [];

if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->getShippingNumber()) {
$carrier = new Carrier($order->id_carrier, (int) $order->getAssociatedLanguage()->getId());
$templateVars = [
'{followup}' => str_replace('@', $order->getShippingNumber(), $carrier->url),
];
Expand Down
10 changes: 4 additions & 6 deletions src/Core/Module/ModuleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,11 @@ public function clearCache(?string $moduleName = null, bool $allShops = false):
}
}
}
}

return true;
} else {
$cacheKey = $this->getCacheKey($moduleName);
if ($this->cacheProvider->contains($cacheKey)) {
return $this->cacheProvider->delete($cacheKey);
}
$cacheKey = $this->getCacheKey($moduleName);
if ($this->cacheProvider->contains($cacheKey)) {
return $this->cacheProvider->delete($cacheKey);
}
}

Expand Down
2 changes: 1 addition & 1 deletion themes/_core/js/checkout-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class Steps {
this.$steps = $(prestashop.selectors.checkout.step);
this.$steps.off('click');

this.$clickableSteps = $(currentStepSelector).prevAll().andSelf();
this.$clickableSteps = $(currentStepSelector).prevAll().addBack();
this.$clickableSteps.addClass('-clickable');
}

Expand Down

0 comments on commit 6d35420

Please sign in to comment.