Skip to content

Commit

Permalink
1.1.10 Release (#84)
Browse files Browse the repository at this point in the history
* 1.1.10 Release

- Added MDVA-38728 patch
- Updated MDVA-35092 patch

* 1.1.10 Release

- Added patches

* 1.1.10 Release
 - Merged conflict between MDVA-42584 and MDVA-41061
 - Updated patch file names to have correct versions

* 1.1.10 Release
 - Added new supported versions to MDVA-33970
 - Updated supported version in MDVA-36286
 - Updated Descriptions

* 1.1.10 Release
 - Updated supported version in MDVA-42584
 - Updated supported version in MDVA-41305
 - Updated Descriptions

Co-authored-by: Andrii Poltoratskyi <poltorat@adobe.com>
  • Loading branch information
agorbivskyi and apoltoratskyi authored Feb 9, 2022
1 parent 6bc47c8 commit a8143bc
Show file tree
Hide file tree
Showing 15 changed files with 1,848 additions and 5 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 Magento 2",
"type": "magento2-component",
"version": "1.1.9",
"version": "1.1.10",
"license": "proprietary",
"repositories": {
"repo": {
Expand Down
2 changes: 1 addition & 1 deletion patches-info.json

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions patches/commerce/MDVA-39181_2.4.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
diff --git a/vendor/magento/module-target-rule/Model/ResourceModel/Index.php b/vendor/magento/module-target-rule/Model/ResourceModel/Index.php
index 4f9a53eb781..669fe639baa 100644
--- a/vendor/magento/module-target-rule/Model/ResourceModel/Index.php
+++ b/vendor/magento/module-target-rule/Model/ResourceModel/Index.php
@@ -45,22 +45,16 @@ class Index extends AbstractDb
protected $_bindIncrement = 0;

/**
- * Target rule data
- *
* @var TargetRuleHelper
*/
protected $_targetRuleData;

/**
- * Core registry
- *
* @var Registry
*/
protected $_coreRegistry;

/**
- * Customer segment data
- *
* @var CustomerSegmentHelper
*/
protected $_customerSegmentData;
@@ -334,7 +328,7 @@ class Index extends AbstractDb
$select->columns('entity_id', 'e');
$select->limit($limit);

- $bind = $this->_prepareRuleActionSelectBind($object, $actionBind);
+ $bind = $this->_prepareRuleActionSelectBind($object, $actionBind, $rule);
$result = $this->getConnection()->fetchCol($select, $bind);

return $result;
@@ -345,10 +339,12 @@ class Index extends AbstractDb
*
* @param TargetRuleIndex $object
* @param array $actionBind
+ * @param Rule $rule
* @return array
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
+ * @SuppressWarnings(PHPMD.NPathComplexity)
*/
- protected function _prepareRuleActionSelectBind($object, $actionBind)
+ protected function _prepareRuleActionSelectBind($object, $actionBind, $rule)
{
$bind = [];
if (!is_array($actionBind)) {
@@ -361,7 +357,8 @@ class Index extends AbstractDb
continue;
}
$k = $bindData['bind'];
- $v = $object->getProduct()->getDataUsingMethod($bindData['field']);
+ $v = ($bindData['field'] === 'category_ids') ? $this->extractCategoryIdsFromRule($rule) :
+ $object->getProduct()->getDataUsingMethod($bindData['field']);

if (!empty($bindData['callback'])) {
$callbacks = $bindData['callback'];
@@ -387,6 +384,25 @@ class Index extends AbstractDb
return $bind;
}

+ /**
+ * Extracts Category ids from Rule
+ *
+ * @param Rule $rule
+ * @return string
+ */
+ private function extractCategoryIdsFromRule(Rule $rule): string
+ {
+ $value = '';
+ foreach ($rule->getConditions()->getConditions() as $condition) {
+ if ($condition->getAttribute() === 'category_ids') {
+ $value = $condition->getValue();
+ break;
+ }
+ }
+
+ return $value;
+ }
+
/**
* Retrieve new SELECT instance (used Read Adapter)
*
132 changes: 132 additions & 0 deletions patches/os/MDVA-35092_2.4.1_v2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
diff --git a/vendor/magento/module-product-video/etc/csp_whitelist.xml b/vendor/magento/module-product-video/etc/csp_whitelist.xml
index ca453605710..2e091440330 100644
--- a/vendor/magento/module-product-video/etc/csp_whitelist.xml
+++ b/vendor/magento/module-product-video/etc/csp_whitelist.xml
@@ -14,6 +14,7 @@
<value id="google_video" type="host">www.googleapis.com</value>
<value id="vimeo" type="host">vimeo.com</value>
<value id="www_vimeo" type="host">www.vimeo.com</value>
+ <value id="vimeo_cdn" type="host">*.vimeocdn.com</value>
</values>
</policy>
<policy id="img-src">
@@ -21,5 +22,10 @@
<value id="vimeo_cdn" type="host">*.vimeocdn.com</value>
</values>
</policy>
+ <policy id="frame-src">
+ <values>
+ <value id="player_vimeo" type="host">player.vimeo.com</value>
+ </values>
+ </policy>
</policies>
</csp_whitelist>
diff --git a/vendor/magento/module-product-video/i18n/en_US.csv b/vendor/magento/module-product-video/i18n/en_US.csv
index debcab151cc..368a83985ba 100644
--- a/vendor/magento/module-product-video/i18n/en_US.csv
+++ b/vendor/magento/module-product-video/i18n/en_US.csv
@@ -41,3 +41,4 @@ Delete,Delete
"Show related video","Show related video"
"Auto restart video","Auto restart video"
"Delete image in all store views","Delete image in all store views"
+"Because of its privacy settings, this video cannot be played here.","Because of its privacy settings, this video cannot be played here."
diff --git a/vendor/magento/module-product-video/view/adminhtml/web/js/get-video-information.js b/vendor/magento/module-product-video/view/adminhtml/web/js/get-video-information.js
index cb56a085304..b034f796875 100644
--- a/vendor/magento/module-product-video/view/adminhtml/web/js/get-video-information.js
+++ b/vendor/magento/module-product-video/view/adminhtml/web/js/get-video-information.js
@@ -495,28 +495,40 @@ define([
*/
function _onVimeoLoaded(data) {
var tmp,
- respData;
+ respData,
+ videoDescription = '';

- if (data.length < 1) {
+ if (!data) {
this._onRequestError($.mage.__('Video not found'));

return null;
}
- tmp = data[0];
- respData = {
- duration: this._formatVimeoDuration(tmp.duration),
- channel: tmp['user_name'],
- channelId: tmp['user_url'],
- uploaded: tmp['upload_date'],
- title: tmp.title,
- description: tmp.description.replace(/(&nbsp;|<([^>]+)>)/ig, ''),
- thumbnail: tmp['thumbnail_large'],
- videoId: videoInfo.id,
- videoProvider: videoInfo.type
- };
- this._videoInformation = respData;
- this.element.trigger(this._UPDATE_VIDEO_INFORMATION_TRIGGER, respData);
- this.element.trigger(this._FINISH_UPDATE_INFORMATION_TRIGGER, true);
+ tmp = data;
+
+ if (tmp.description !== null) {
+ videoDescription = tmp.description;
+ }
+
+ if (tmp.duration == null) {
+ this._onRequestError(
+ $.mage.__('Because of its privacy settings, this video cannot be played here.')
+ );
+ } else {
+ respData = {
+ duration: this._formatVimeoDuration(tmp.duration),
+ channel: tmp['author_name'],
+ channelId: tmp['author_url'],
+ uploaded: tmp['upload_date'],
+ title: tmp.title,
+ description: videoDescription.replace(/(&nbsp;|<([^>]+)>)/ig, ''),
+ thumbnail: tmp['thumbnail_url'],
+ videoId: videoInfo.id,
+ videoProvider: videoInfo.type
+ };
+ this._videoInformation = respData;
+ this.element.trigger(this._UPDATE_VIDEO_INFORMATION_TRIGGER, respData);
+ this.element.trigger(this._FINISH_UPDATE_INFORMATION_TRIGGER, true);
+ }
}

type = videoInfo.type;
@@ -539,10 +551,11 @@ define([
);
} else if (type === 'vimeo') {
$.ajax({
- url: 'https://www.vimeo.com/api/v2/video/' + id + '.json',
+ url: 'https://vimeo.com/api/oembed.json',
dataType: 'jsonp',
data: {
- format: 'json'
+ format: 'json',
+ url: 'https://vimeo.com/' + id
},
timeout: 5000,
success: $.proxy(_onVimeoLoaded, self),
diff --git a/lib/web/fotorama/fotorama.js b/lib/web/fotorama/fotorama.js
index 314949bd2f4..f268c9aa736 100644
--- a/lib/web/fotorama/fotorama.js
+++ b/lib/web/fotorama/fotorama.js
@@ -858,13 +858,16 @@ fotoramaVersion = '4.6.4';
dataFrame.thumbsReady = true;
} else if (video.type === 'vimeo') {
$.ajax({
- url: getProtocol() + 'vimeo.com/api/v2/video/' + video.id + '.json',
+ url: getProtocol() + 'vimeo.com/api/oembed.json',
+ data: {
+ url: 'https://vimeo.com/' + video.id
+ },
dataType: 'jsonp',
success: function (json) {
dataFrame.thumbsReady = true;
updateData(data, {
- img: json[0].thumbnail_large,
- thumb: json[0].thumbnail_small
+ img: json[0].thumbnail_url,
+ thumb: json[0].thumbnail_url
}, dataFrame.i, fotorama);
}
});
24 changes: 24 additions & 0 deletions patches/os/MDVA-38678_2.4.2-p1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/vendor/magento/module-sales/Ui/Component/Listing/Column/Price.php b/vendor/magento/module-sales/Ui/Component/Listing/Column/Price.php
index 4ffb6f98447..cc323730f14 100644
--- a/vendor/magento/module-sales/Ui/Component/Listing/Column/Price.php
+++ b/vendor/magento/module-sales/Ui/Component/Listing/Column/Price.php
@@ -10,6 +10,7 @@ namespace Magento\Sales\Ui\Component\Listing\Column;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
+use Magento\Store\Model\Store;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Ui\Component\Listing\Columns\Column;
use Magento\Framework\Pricing\PriceCurrencyInterface;
@@ -77,8 +78,10 @@ class Price extends Column
foreach ($dataSource['data']['items'] as & $item) {
$currencyCode = isset($item['base_currency_code']) ? $item['base_currency_code'] : null;
if (!$currencyCode) {
+ $storeId = isset($item['store_id']) && (int)$item['store_id'] !== 0 ? $item['store_id'] :
+ $this->context->getFilterParam('store_id', Store::DEFAULT_STORE_ID);
$store = $this->storeManager->getStore(
- $this->context->getFilterParam('store_id', \Magento\Store\Model\Store::DEFAULT_STORE_ID)
+ $storeId
);
$currencyCode = $store->getBaseCurrency()->getCurrencyCode();
}
53 changes: 53 additions & 0 deletions patches/os/MDVA-38728_2.3.3-p1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
diff --git a/vendor/magento/module-catalog-url-rewrite/Model/Products/AdaptUrlRewritesToVisibilityAttribute.php b/vendor/magento/module-catalog-url-rewrite/Model/Products/AdaptUrlRewritesToVisibilityAttribute.php
index f5851cf1e11b..d329bdf0200a 100644
--- a/vendor/magento/module-catalog-url-rewrite/Model/Products/AdaptUrlRewritesToVisibilityAttribute.php
+++ b/vendor/magento/module-catalog-url-rewrite/Model/Products/AdaptUrlRewritesToVisibilityAttribute.php
@@ -65,11 +65,12 @@ public function __construct(
*
* @param array $productIds
* @param int $visibility
+ * @param int $storeId
* @throws UrlAlreadyExistsException
*/
- public function execute(array $productIds, int $visibility): void
+ public function execute(array $productIds, int $visibility, int $storeId): void
{
- $products = $this->getProductsByIds($productIds);
+ $products = $this->getProductsByIds($productIds, $storeId);

/** @var Product $product */
foreach ($products as $product) {
@@ -110,11 +111,13 @@ public function execute(array $productIds, int $visibility): void
* Get Product Models by Id's
*
* @param array $productIds
+ * @param int $storeId
* @return array
*/
- private function getProductsByIds(array $productIds): array
+ private function getProductsByIds(array $productIds, int $storeId): array
{
$productCollection = $this->productCollectionFactory->create();
+ $productCollection->setStoreId($storeId);
$productCollection->addAttributeToSelect(ProductInterface::VISIBILITY);
$productCollection->addAttributeToSelect('url_key');
$productCollection->addFieldToFilter(
diff --git a/vendor/magento/module-catalog-url-rewrite/Observer/ProcessUrlRewriteOnChangeProductVisibilityObserver.php b/vendor/magento/module-catalog-url-rewrite/Observer/ProcessUrlRewriteOnChangeProductVisibilityObserver.php
index 2337bb3646bd..cd6350bfce12 100644
--- a/vendor/magento/module-catalog-url-rewrite/Observer/ProcessUrlRewriteOnChangeProductVisibilityObserver.php
+++ b/vendor/magento/module-catalog-url-rewrite/Observer/ProcessUrlRewriteOnChangeProductVisibilityObserver.php
@@ -43,12 +43,13 @@ public function execute(Observer $observer)
$event = $observer->getEvent();
$attrData = $event->getAttributesData();
$productIds = $event->getProductIds();
+ $storeIdFromScope = $event->getStoreId();
$visibility = $attrData[ProductInterface::VISIBILITY] ?? 0;

if (!$visibility || !$productIds) {
return;
}

- $this->adaptUrlRewritesToVisibility->execute($productIds, (int)$visibility);
+ $this->adaptUrlRewritesToVisibility->execute($productIds, (int)$visibility, (int)$storeIdFromScope);
}
}
28 changes: 28 additions & 0 deletions patches/os/MDVA-40175_2.4.2-p1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/vendor/magento/module-sales/view/adminhtml/templates/order/create/shipping/method/form.phtml b/vendor/magento/module-sales/view/adminhtml/templates/order/create/shipping/method/form.phtml
index fd5b7a55b49..d745a265e6d 100644
--- a/vendor/magento/module-sales/view/adminhtml/templates/order/create/shipping/method/form.phtml
+++ b/vendor/magento/module-sales/view/adminhtml/templates/order/create/shipping/method/form.phtml
@@ -38,11 +38,6 @@ $taxHelper = $block->getData('taxHelper');
value="<?= $block->escapeHtmlAttr($_code) ?>"
id="s_method_<?= $block->escapeHtmlAttr($_code) ?>" <?= /* @noEscape */ $_checked ?>
class="admin__control-radio required-entry"/>
- <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
- 'onclick',
- "order.setShippingMethod(this.value)",
- 'input#s_method_' . $block->escapeHtmlAttr($_code)
- ) ?>
<label class="admin__field-label" for="s_method_<?= $block->escapeHtmlAttr($_code) ?>">
<?= $block->escapeHtml($_rate->getMethodTitle() ?
$_rate->getMethodTitle() : $_rate->getMethodDescription()) ?> -
@@ -59,6 +54,11 @@ $taxHelper = $block->getData('taxHelper');
<?php endif; ?>
</strong>
</label>
+ <?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
+ 'onclick',
+ "order.setShippingMethod(this.value)",
+ 'input#s_method_' . $block->escapeHtmlAttr($_code)
+ ) ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
55 changes: 55 additions & 0 deletions patches/os/MDVA-40816_1.2.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
diff --git a/vendor/magento/module-inventory-catalog-admin-ui/Ui/DataProvider/Product/Listing/Modifier/QuantityPerSource.php b/vendor/magento/module-inventory-catalog-admin-ui/Ui/DataProvider/Product/Listing/Modifier/QuantityPerSource.php
index 38bbf4428ee..7b43dbf6a87 100644
--- a/vendor/magento/module-inventory-catalog-admin-ui/Ui/DataProvider/Product/Listing/Modifier/QuantityPerSource.php
+++ b/vendor/magento/module-inventory-catalog-admin-ui/Ui/DataProvider/Product/Listing/Modifier/QuantityPerSource.php
@@ -105,6 +105,7 @@ class QuantityPerSource extends AbstractModifier

foreach ($dataItems as $key => $item) {
if (in_array($item['type_id'], $allowedProductTypes)) {
+ $item['sku'] = htmlspecialchars_decode($item['sku'], ENT_QUOTES | ENT_SUBSTITUTE);
$itemsBySkus[$item['sku']] = $key;
continue;
}
diff --git a/vendor/magento/module-inventory-sales-admin-ui/Model/GetSalableQuantityDataBySku.php b/vendor/magento/module-inventory-sales-admin-ui/Model/GetSalableQuantityDataBySku.php
index edafa5ea823..019e163d647 100644
--- a/vendor/magento/module-inventory-sales-admin-ui/Model/GetSalableQuantityDataBySku.php
+++ b/vendor/magento/module-inventory-sales-admin-ui/Model/GetSalableQuantityDataBySku.php
@@ -7,13 +7,17 @@ declare(strict_types=1);

namespace Magento\InventorySalesAdminUi\Model;

+use Magento\Framework\Exception\InputException;
+use Magento\Framework\Exception\LocalizedException;
+use Magento\Framework\Exception\NoSuchEntityException;
+use Magento\InventoryConfigurationApi\Exception\SkuIsNotAssignedToStockException;
use Magento\InventorySalesAdminUi\Model\ResourceModel\GetAssignedStockIdsBySku;
use Magento\InventoryApi\Api\StockRepositoryInterface;
use Magento\InventorySalesApi\Api\GetProductSalableQtyInterface;
use Magento\InventoryConfigurationApi\Api\GetStockItemConfigurationInterface;

/**
- * Get salable quantity data by sku
+ * Get salable quantity data of product by sku
*/
class GetSalableQuantityDataBySku
{
@@ -56,12 +60,19 @@ class GetSalableQuantityDataBySku
}

/**
+ * Get salable quantity of product by sku
+ *
* @param string $sku
* @return array
+ * @throws InputException
+ * @throws LocalizedException
+ * @throws NoSuchEntityException
+ * @throws SkuIsNotAssignedToStockException
*/
public function execute(string $sku): array
{
$stockInfo = [];
+ $sku = htmlspecialchars_decode($sku, ENT_QUOTES | ENT_SUBSTITUTE);
$stockIds = $this->getAssignedStockIdsBySku->execute($sku);
if (count($stockIds)) {
foreach ($stockIds as $stockId) {
Loading

0 comments on commit a8143bc

Please sign in to comment.