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'

0 commit comments

Comments
 (0)