Skip to content

Commit

Permalink
Merge pull request #146 from magento-commerce/1.1.41-release
Browse files Browse the repository at this point in the history
1.1.41 Release
  • Loading branch information
apoltoratskyi authored Nov 8, 2023
2 parents 604135b + d10d1d6 commit ab775cf
Show file tree
Hide file tree
Showing 18 changed files with 2,016 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/quality-patches",
"description": "Provides quality patches for AdobeCommerce & Magento OpenSource",
"type": "magento2-component",
"version": "1.1.40",
"version": "1.1.41",
"license": "proprietary",
"repositories": {
"repo": {
Expand Down
2 changes: 1 addition & 1 deletion patches-info.json

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions patches/commerce/ACSD-51819_2.4.4-p2_v6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff --git a/vendor/magento/module-async-order/Model/CartRepository.php b/vendor/magento/module-async-order/Model/CartRepository.php
index 3f6946c483c..59c39a567b9 100644
--- a/vendor/magento/module-async-order/Model/CartRepository.php
+++ b/vendor/magento/module-async-order/Model/CartRepository.php
@@ -9,6 +9,7 @@ declare(strict_types=1);
namespace Magento\AsyncOrder\Model;

use Magento\Framework\Api\SearchCriteriaInterface;
+use Magento\Framework\App\DeploymentConfig;
use Magento\Quote\Api\CartRepositoryInterface;
use Magento\Quote\Api\Data\CartInterface;
use Magento\Quote\Model\QuoteRepository;
@@ -23,15 +24,23 @@ class CartRepository implements CartRepositoryInterface
*/
private $quoteRepository;

+ /**
+ * @var DeploymentConfig
+ */
+ private DeploymentConfig $deploymentConfig;
+
/**
* Constructor
*
* @param QuoteRepository $quoteRepository
+ * @param DeploymentConfig $deploymentConfig
*/
public function __construct(
- QuoteRepository $quoteRepository
+ QuoteRepository $quoteRepository,
+ DeploymentConfig $deploymentConfig
) {
$this->quoteRepository = $quoteRepository;
+ $this->deploymentConfig = $deploymentConfig;
}

/**
@@ -55,6 +64,9 @@ class CartRepository implements CartRepositoryInterface
*/
public function getActive($cartId, array $sharedStoreIds = [])
{
+ if (!$this->deploymentConfig->get(OrderManagement::ASYNC_ORDER_OPTION_PATH)) {
+ return $this->quoteRepository->getActive($cartId, $sharedStoreIds);
+ }
return $this->get($cartId, $sharedStoreIds);
}

89 changes: 89 additions & 0 deletions patches/commerce/ACSD-53118_2.4.5-p2_v2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
diff --git a/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Product/Attribute.php b/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Product/Attribute.php
index 4e90156..cd2b85f 100644
--- a/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Product/Attribute.php
+++ b/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Product/Attribute.php
@@ -7,6 +7,10 @@ namespace Magento\AdvancedSalesRule\Model\Rule\Condition\FilterTextGenerator\Pro

use Magento\AdvancedSalesRule\Model\Rule\Condition\ConcreteCondition\Product\Attribute as AttributeCondition;
use Magento\AdvancedRule\Model\Condition\FilterTextGeneratorInterface;
+use Magento\Catalog\Model\Product;
+use Magento\Eav\Model\Config;
+use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
+use Magento\Framework\Locale\FormatInterface;

class Attribute implements FilterTextGeneratorInterface
{
@@ -16,28 +20,48 @@ class Attribute implements FilterTextGeneratorInterface
protected $attributeCode;

/**
+ * @var FormatInterface
+ */
+ private FormatInterface $localeFormat;
+
+ /**
+ * @var Config
+ */
+ private Config $config;
+
+ /**
* @param array $data
+ * @param Config $config
+ * @param FormatInterface $localeFormat
*/
- public function __construct(array $data)
- {
+ public function __construct(
+ array $data,
+ Config $config,
+ FormatInterface $localeFormat
+ ) {
$this->attributeCode = $data['attribute'];
+ $this->config = $config;
+ $this->localeFormat = $localeFormat;
}

/**
- * @param \Magento\Framework\DataObject $quoteAddress
- * @return string[]
+ * @inheritdoc
*/
public function generateFilterText(\Magento\Framework\DataObject $quoteAddress)
{
$filterText = [];
if ($quoteAddress instanceof \Magento\Quote\Model\Quote\Address) {
$items = $quoteAddress->getAllItems();
+ $attribute = $this->getAttributeObject();
foreach ($items as $item) {
$product = $item->getProduct();
if (!$product->hasData($this->attributeCode)) {
$product->load($product->getId());
}
$value = $product->getData($this->attributeCode);
+ if ($attribute && $attribute->getBackendType() === 'decimal') {
+ $value = $this->localeFormat->getNumber($value);
+ }
if (is_scalar($value)) {
$text = AttributeCondition::FILTER_TEXT_PREFIX . $this->attributeCode . ':' . $value;
if (!in_array($text, $filterText)) {
@@ -48,4 +72,20 @@ class Attribute implements FilterTextGeneratorInterface
}
return $filterText;
}
+
+ /**
+ * Retrieve attribute object
+ *
+ * @return ?AbstractAttribute
+ */
+ private function getAttributeObject(): ?AbstractAttribute
+ {
+ try {
+ $attributeObject = $this->config->getAttribute(Product::ENTITY, $this->attributeCode);
+ } catch (\Exception $e) {
+ $attributeObject = null;
+ }
+
+ return $attributeObject;
+ }
}
36 changes: 36 additions & 0 deletions patches/commerce/ACSD-53643_1.3.5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/vendor/magento/module-purchase-order/Model/Validator/ActionReady/PlaceOrderValidator.php b/vendor/magento/module-purchase-order/Model/Validator/ActionReady/PlaceOrderValidator.php
index 69e1169e080c..d3b0cbe8bd9f 100644
--- a/vendor/magento/module-purchase-order/Model/Validator/ActionReady/PlaceOrderValidator.php
+++ b/vendor/magento/module-purchase-order/Model/Validator/ActionReady/PlaceOrderValidator.php
@@ -20,6 +20,7 @@ class PlaceOrderValidator implements ValidatorInterface
public function validate(PurchaseOrderInterface $purchaseOrder): bool
{
$status = $purchaseOrder->getStatus();
+ $quote = $purchaseOrder->getSnapshotQuote();
$placeOrderStatuses = [
PurchaseOrderInterface::STATUS_APPROVED,
PurchaseOrderInterface::STATUS_ORDER_FAILED
@@ -27,6 +28,7 @@ public function validate(PurchaseOrderInterface $purchaseOrder): bool
if (!in_array($status, $placeOrderStatuses)
|| (null != $purchaseOrder->getOrderId())
|| !$purchaseOrder->getQuoteId()
+ || $quote->getHasError()
) {
return false;
}
diff --git a/vendor/magento/module-purchase-order/view/frontend/templates/purchaseorder/view/info/buttons.phtml b/vendor/magento/module-purchase-order/view/frontend/templates/purchaseorder/view/info/buttons.phtml
index 6310f5164a92..e6dbcaa6d86b 100644
--- a/vendor/magento/module-purchase-order/view/frontend/templates/purchaseorder/view/info/buttons.phtml
+++ b/vendor/magento/module-purchase-order/view/frontend/templates/purchaseorder/view/info/buttons.phtml
@@ -47,9 +47,11 @@
<?php if ($block->paymentRequired()): ?>
<input type="hidden" name="payment_redirect" value="1">
<?php endif; ?>
+ <?php if (!$block->hasError()): ?>
<button type="submit" class="action placeorder primary">
<span><?= $escaper->escapeHtml(__('Place Order')) ?></span>
</button>
+ <?php endif; ?>
</form>
<?php endif; ?>

Loading

0 comments on commit ab775cf

Please sign in to comment.