Skip to content

Commit b35ded1

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop Minor Fixes
Accepted Public Pull Requests: - #21129: Remove unused reference on wishlist ConvertSerializedData controller (by @sasangagamlath) - #20115: Fixed Issue #19891 ,Added checks of type_id (by @GovindaSharma) - #21100: [Sales] Improves the UX by scrolling down the customer to the Recent Orders (by @eduard13) - #20887: Removed github oauth token in sample file. The token is a personal to� (by @hostep) - #21090: Add alt text to saved payment method for accessibility (by @pmclain) - #21096: Updated sprintf usage; Simplified isset usage (by @df2k2) - #21097: Apply PHP-CS-Fixer "braces" fixes on `if` and `foreach` statements (by @yogeshsuhagiya) - #21007: disable add to cart until page load (by @sunilit42) - #21022: products-in-category-checkbox-not-align-properly (by @priti2jcommerce) - magento/bulk-api-ce#33: Set isSecureArea to allow delete from ConsumerInterface::process (by @pmclain) - #20499: Fix typo in _resets.less (by @sjaakvdbrom) - #20027: hardcoded table name (by @melaxon) - #20012: typos corrected (by @mjsachan-cedcoss) - #19631: Backend: Fixed checkbox alignment (by @suryakant-krish) Fixed GitHub Issues: - #19891: product_type attribute contains incorrect value in mass import export csv after creating custom type_id attribute. actual type_id value in database gets change with newly created attribute type_id. (reported by @Surabhi-Cedcoss) has been fixed in #20115 by @GovindaSharma in 2.3-develop branch Related commits: 1. b9d13e6 - #21089: No accessible label for vault-saved credit card type (reported by @scottsb) has been fixed in #21090 by @pmclain in 2.3-develop branch Related commits: 1. 8483e94 2. db4c00c - #21021: products in category checkbox not align properly (reported by @priti2jcommerce) has been fixed in #21022 by @priti2jcommerce in 2.3-develop branch Related commits: 1. bf2a704 2. 6e7734e 3. bc3fa6b 4. bf6d023 - #19630: Checkbox alignment issue backend. (reported by @suryakant-krish) has been fixed in #19631 by @suryakant-krish in 2.3-develop branch Related commits: 1. d0c0bcc 2. dce80fd 3. dd04443 4. d0d57e3 5. a2c9050
2 parents d3a6707 + dd17e95 commit b35ded1

File tree

23 files changed

+93
-57
lines changed

23 files changed

+93
-57
lines changed

app/code/Magento/AsynchronousOperations/Model/MassConsumer.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace Magento\AsynchronousOperations\Model;
1010

1111
use Magento\Framework\App\ResourceConnection;
12+
use Magento\Framework\Registry;
1213
use Psr\Log\LoggerInterface;
1314
use Magento\Framework\MessageQueue\MessageLockException;
1415
use Magento\Framework\MessageQueue\ConnectionLostException;
@@ -58,6 +59,11 @@ class MassConsumer implements ConsumerInterface
5859
*/
5960
private $operationProcessor;
6061

62+
/**
63+
* @var Registry
64+
*/
65+
private $registry;
66+
6167
/**
6268
* Initialize dependencies.
6369
*
@@ -67,14 +73,16 @@ class MassConsumer implements ConsumerInterface
6773
* @param ConsumerConfigurationInterface $configuration
6874
* @param OperationProcessorFactory $operationProcessorFactory
6975
* @param LoggerInterface $logger
76+
* @param Registry $registry
7077
*/
7178
public function __construct(
7279
CallbackInvoker $invoker,
7380
ResourceConnection $resource,
7481
MessageController $messageController,
7582
ConsumerConfigurationInterface $configuration,
7683
OperationProcessorFactory $operationProcessorFactory,
77-
LoggerInterface $logger
84+
LoggerInterface $logger,
85+
Registry $registry = null
7886
) {
7987
$this->invoker = $invoker;
8088
$this->resource = $resource;
@@ -84,20 +92,26 @@ public function __construct(
8492
'configuration' => $configuration
8593
]);
8694
$this->logger = $logger;
95+
$this->registry = $registry ?? \Magento\Framework\App\ObjectManager::getInstance()
96+
->get(Registry::class);
8797
}
8898

8999
/**
90-
* {@inheritdoc}
100+
* @inheritdoc
91101
*/
92102
public function process($maxNumberOfMessages = null)
93103
{
104+
$this->registry->register('isSecureArea', true, true);
105+
94106
$queue = $this->configuration->getQueue();
95107

96108
if (!isset($maxNumberOfMessages)) {
97109
$queue->subscribe($this->getTransactionCallback($queue));
98110
} else {
99111
$this->invoker->invoke($queue, $maxNumberOfMessages, $this->getTransactionCallback($queue));
100112
}
113+
114+
$this->registry->unregister('isSecureArea');
101115
}
102116

103117
/**

app/code/Magento/Bundle/view/adminhtml/templates/catalog/product/edit/tab/attributes/extend.phtml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ $isElementReadonly = $block->getElement()
2020
->getReadonly();
2121
?>
2222

23-
<?php if (!($attributeCode === 'price' && $block->getCanReadPrice() === false)) { ?>
23+
<?php if (!($attributeCode === 'price' && $block->getCanReadPrice() === false)): ?>
2424
<div class="<?= /* @escapeNotVerified */ $attributeCode ?> "><?= /* @escapeNotVerified */ $elementHtml ?></div>
25-
<?php } ?>
25+
<?php endif; ?>
2626

2727
<?= $block->getExtendedElement($switchAttributeCode)->toHtml() ?>
2828

@@ -43,13 +43,13 @@ $isElementReadonly = $block->getElement()
4343
} else {
4444
if ($attribute) {
4545
<?php if ($attributeCode === 'price' && !$block->getCanEditPrice() && $block->getCanReadPrice()
46-
&& $block->getProduct()->isObjectNew()) { ?>
46+
&& $block->getProduct()->isObjectNew()): ?>
4747
<?php $defaultProductPrice = $block->getDefaultProductPrice() ?: "''"; ?>
4848
$attribute.value = <?= /* @escapeNotVerified */ $defaultProductPrice ?>;
49-
<?php } else { ?>
49+
<?php else: ?>
5050
$attribute.disabled = false;
5151
$attribute.addClassName('required-entry');
52-
<?php } ?>
52+
<?php endif; ?>
5353
}
5454
if ($('dynamic-price-warning')) {
5555
$('dynamic-price-warning').hide();
@@ -58,9 +58,9 @@ $isElementReadonly = $block->getElement()
5858
}
5959

6060
<?php if (!($attributeCode === 'price' && !$block->getCanEditPrice()
61-
&& !$block->getProduct()->isObjectNew())) { ?>
61+
&& !$block->getProduct()->isObjectNew())): ?>
6262
$('<?= /* @escapeNotVerified */ $switchAttributeCode ?>').observe('change', <?= /* @escapeNotVerified */ $switchAttributeCode ?>_change);
63-
<?php } ?>
63+
<?php endif; ?>
6464
Event.observe(window, 'load', function(){
6565
<?= /* @escapeNotVerified */ $switchAttributeCode ?>_change();
6666
});

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function execute()
105105
$attributeCode
106106
);
107107

108-
if ($attribute->getId() && !$attributeId || $attributeCode === 'product_type') {
108+
if ($attribute->getId() && !$attributeId || $attributeCode === 'product_type' || $attributeCode === 'type_id') {
109109
$message = strlen($this->getRequest()->getParam('attribute_code'))
110110
? __('An attribute with this code already exists.')
111111
: __('An attribute with the same code (%1) already exists.', $attributeCode);

app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
use Magento\Framework\App\ResourceConnection;
1010

11+
/**
12+
* Abstract action class for category flat indexers.
13+
*/
1114
class AbstractAction
1215
{
1316
/**
@@ -130,7 +133,7 @@ protected function getFlatTableStructure($tableName)
130133
$table = $this->connection->newTable(
131134
$tableName
132135
)->setComment(
133-
sprintf("Catalog Category Flat", $tableName)
136+
'Catalog Category Flat'
134137
);
135138

136139
//Adding columns
@@ -378,7 +381,7 @@ protected function getAttributeValues($entityIds, $storeId)
378381
$linkField = $this->getCategoryMetadata()->getLinkField();
379382
foreach ($attributesType as $type) {
380383
foreach ($this->getAttributeTypeValues($type, $entityIds, $storeId) as $row) {
381-
if (isset($row[$linkField]) && isset($row['attribute_id'])) {
384+
if (isset($row[$linkField], $row['attribute_id'])) {
382385
$attributeId = $row['attribute_id'];
383386
if (isset($attributes[$attributeId])) {
384387
$attributeCode = $attributes[$attributeId]['attribute_code'];
@@ -496,6 +499,8 @@ protected function getTableName($name)
496499
}
497500

498501
/**
502+
* Get category metadata instance.
503+
*
499504
* @return \Magento\Framework\EntityManager\EntityMetadata
500505
*/
501506
private function getCategoryMetadata()
@@ -509,6 +514,8 @@ private function getCategoryMetadata()
509514
}
510515

511516
/**
517+
* Get skip static columns instance.
518+
*
512519
* @return array
513520
*/
514521
private function getSkipStaticColumns()

app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function _isApplicableAttribute($object, $attribute)
9999
*/
100100
protected function _isCallableAttributeInstance($instance, $method, $args)
101101
{
102-
if ($instance instanceof \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
102+
if ($instance instanceof AbstractBackend
103103
&& ($method == 'beforeSave' || $method == 'afterSave')
104104
) {
105105
$attributeCode = $instance->getAttribute()->getAttributeCode();
@@ -491,7 +491,7 @@ protected function _canUpdateAttribute(AbstractAttribute $attribute, $value, arr
491491
* Retrieve attribute's raw value from DB.
492492
*
493493
* @param int $entityId
494-
* @param int|string|array $attribute atrribute's ids or codes
494+
* @param int|string|array $attribute attribute's ids or codes
495495
* @param int|\Magento\Store\Model\Store $store
496496
* @return bool|string|array
497497
* @SuppressWarnings(PHPMD.CyclomaticComplexity)

app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByBasePrice.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use Magento\Framework\DB\Select;
1212
use Magento\Store\Model\Store;
1313

14+
/**
15+
* Provide Select object for retrieve product id with minimal price.
16+
*/
1417
class LinkedProductSelectBuilderByBasePrice implements LinkedProductSelectBuilderInterface
1518
{
1619
/**
@@ -69,7 +72,7 @@ public function __construct(
6972
}
7073

7174
/**
72-
* {@inheritdoc}
75+
* @inheritdoc
7376
*/
7477
public function build($productId)
7578
{
@@ -85,7 +88,7 @@ public function build($productId)
8588
[]
8689
)->joinInner(
8790
[BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS => $productTable],
88-
sprintf('%s.entity_id = link.child_id', BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS, $linkField),
91+
sprintf('%s.entity_id = link.child_id', BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS),
8992
['entity_id']
9093
)->joinInner(
9194
['t' => $priceAttribute->getBackendTable()],

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154

155155
<fillField stepKey="fillCategoryName" selector="{{AdminProductCategoryCreationSection.nameInput}}" userInput="{{categoryName}}"/>
156156

157-
<!-- Search and select a parent catagory for the product -->
157+
<!-- Search and select a parent category for the product -->
158158
<click stepKey="clickParentCategory" selector="{{AdminProductCategoryCreationSection.parentCategory}}"/>
159159
<waitForPageLoad stepKey="waitForDropDownVisible"/>
160160
<fillField stepKey="searchForParent" userInput="{{parentCategoryName}}" selector="{{AdminProductCategoryCreationSection.parentSearch}}"/>

app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<button type="submit"
3434
title="<?= /* @escapeNotVerified */ $buttonTitle ?>"
3535
class="action primary tocart"
36-
id="product-addtocart-button">
36+
id="product-addtocart-button" disabled>
3737
<span><?= /* @escapeNotVerified */ $buttonTitle ?></span>
3838
</button>
3939
<?= $block->getChildHtml('', true) ?>

app/code/Magento/Catalog/view/frontend/web/js/validate-product.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ define([
1313
$.widget('mage.productValidate', {
1414
options: {
1515
bindSubmit: false,
16-
radioCheckboxClosest: '.nested'
16+
radioCheckboxClosest: '.nested',
17+
addToCartButtonSelector: '.action.tocart'
1718
},
1819

1920
/**
@@ -41,6 +42,7 @@ define([
4142
return false;
4243
}
4344
});
45+
$(this.options.addToCartButtonSelector).attr('disabled', false);
4446
}
4547
});
4648

app/code/Magento/Directory/Model/ResourceModel/Currency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ protected function _getRatesByCode($code, $toCurrencies = null)
216216
$connection = $this->getConnection();
217217
$bind = [':currency_from' => $code];
218218
$select = $connection->select()->from(
219-
$this->getTable('directory_currency_rate'),
219+
$this->_currencyRateTable,
220220
['currency_to', 'rate']
221221
)->where(
222222
'currency_from = :currency_from'

app/code/Magento/Payment/Model/CcConfigProvider.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(
4444
}
4545

4646
/**
47-
* {@inheritdoc}
47+
* @inheritdoc
4848
*/
4949
public function getConfig()
5050
{
@@ -69,7 +69,7 @@ public function getIcons()
6969
}
7070

7171
$types = $this->ccConfig->getCcAvailableTypes();
72-
foreach (array_keys($types) as $code) {
72+
foreach ($types as $code => $label) {
7373
if (!array_key_exists($code, $this->icons)) {
7474
$asset = $this->ccConfig->createAsset('Magento_Payment::images/cc/' . strtolower($code) . '.png');
7575
$placeholder = $this->assetSource->findSource($asset);
@@ -78,7 +78,8 @@ public function getIcons()
7878
$this->icons[$code] = [
7979
'url' => $asset->getUrl(),
8080
'width' => $width,
81-
'height' => $height
81+
'height' => $height,
82+
'title' => __($label),
8283
];
8384
}
8485
}

app/code/Magento/Payment/Test/Unit/Model/CcConfigProviderTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ public function testGetConfig()
4242
'vi' => [
4343
'url' => 'http://cc.card/vi.png',
4444
'width' => getimagesize($imagesDirectoryPath . 'vi.png')[0],
45-
'height' => getimagesize($imagesDirectoryPath . 'vi.png')[1]
45+
'height' => getimagesize($imagesDirectoryPath . 'vi.png')[1],
46+
'title' => __('Visa'),
4647
],
4748
'ae' => [
4849
'url' => 'http://cc.card/ae.png',
4950
'width' => getimagesize($imagesDirectoryPath . 'ae.png')[0],
50-
'height' => getimagesize($imagesDirectoryPath . 'ae.png')[1]
51+
'height' => getimagesize($imagesDirectoryPath . 'ae.png')[1],
52+
'title' => __('American Express'),
5153
]
5254
]
5355
]
@@ -56,19 +58,25 @@ public function testGetConfig()
5658

5759
$ccAvailableTypesMock = [
5860
'vi' => [
61+
'title' => 'Visa',
5962
'fileId' => 'Magento_Payment::images/cc/vi.png',
6063
'path' => $imagesDirectoryPath . 'vi.png',
6164
'url' => 'http://cc.card/vi.png'
6265
],
6366
'ae' => [
67+
'title' => 'American Express',
6468
'fileId' => 'Magento_Payment::images/cc/ae.png',
6569
'path' => $imagesDirectoryPath . 'ae.png',
6670
'url' => 'http://cc.card/ae.png'
6771
]
6872
];
6973
$assetMock = $this->createMock(\Magento\Framework\View\Asset\File::class);
7074

71-
$this->ccConfigMock->expects($this->once())->method('getCcAvailableTypes')->willReturn($ccAvailableTypesMock);
75+
$this->ccConfigMock->expects($this->once())->method('getCcAvailableTypes')
76+
->willReturn(array_combine(
77+
array_keys($ccAvailableTypesMock),
78+
array_column($ccAvailableTypesMock, 'title')
79+
));
7280

7381
$this->ccConfigMock->expects($this->atLeastOnce())
7482
->method('createAsset')

app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<element name="website" type="radio" selector="//label[contains(text(), '{{arg}}')]" parameterized="true"/>
2121
<element name="addProducts" type="button" selector="#add_products"/>
22-
<element name="selectProduct" type="checkbox" selector="//td[contains(text(), '{{arg}}')]/following-sibling::td[contains(@class, 'col-select col-in_products')]" parameterized="true"/>
22+
<element name="selectProduct" type="checkbox" selector="//td[contains(text(), '{{arg}}')]/following-sibling::td[contains(@class, 'col-select col-in_products')]/label/input" parameterized="true"/>
2323
<element name="setQuantity" type="checkbox" selector="//td[contains(text(), '{{arg}}')]/following-sibling::td[contains(@class, 'col-qty')]/input" parameterized="true"/>
2424
<element name="addProductsToOrder" type="button" selector="//span[text()='Add Selected Product(s) to Order']"/>
2525
<element name="customPrice" type="checkbox" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/div//span[contains(text(),'Custom Price')]" parameterized="true"/>

app/code/Magento/Sales/view/frontend/templates/reorder/sidebar.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
</button>
5858
</div>
5959
<div class="secondary">
60-
<a class="action view" href="<?= /* @escapeNotVerified */ $block->getUrl('customer/account') ?>">
60+
<a class="action view" href="<?= /* @escapeNotVerified */ $block->getUrl('customer/account') ?>#my-orders-table">
6161
<span><?= /* @escapeNotVerified */ __('View All') ?></span>
6262
</a>
6363
</div>

app/code/Magento/Swatches/view/frontend/templates/product/layered/renderer.phtml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<a href="<?= /* @escapeNotVerified */ $label['link'] ?>"
1818
aria-label="<?= /* @escapeNotVerified */ $label['label'] ?>"
1919
class="swatch-option-link-layered">
20-
<?php if (isset($swatchData['swatches'][$option]['type'])) { ?>
20+
<?php if (isset($swatchData['swatches'][$option]['type'])): ?>
2121
<?php switch ($swatchData['swatches'][$option]['type']) {
2222
case '3':
2323
?>
@@ -32,10 +32,8 @@
3232
<?php break;
3333
case '2':
3434
?>
35-
<?php $swatchThumbPath = $block->getSwatchPath('swatch_thumb',
36-
$swatchData['swatches'][$option]['value']); ?>
37-
<?php $swatchImagePath = $block->getSwatchPath('swatch_image',
38-
$swatchData['swatches'][$option]['value']); ?>
35+
<?php $swatchThumbPath = $block->getSwatchPath('swatch_thumb', $swatchData['swatches'][$option]['value']); ?>
36+
<?php $swatchImagePath = $block->getSwatchPath('swatch_image', $swatchData['swatches'][$option]['value']); ?>
3937
<div class="swatch-option image <?= /* @escapeNotVerified */ $label['custom_style'] ?>"
4038
tabindex="-1"
4139
option-type="2"
@@ -69,7 +67,7 @@
6967
><?= /* @escapeNotVerified */ $swatchData['swatches'][$option]['value'] ?></div>
7068
<?php break;
7169
} ?>
72-
<?php } ?>
70+
<?php endif; ?>
7371
</a>
7472
<?php endforeach; ?>
7573
</div>

0 commit comments

Comments
 (0)