Skip to content

Commit ec99590

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1192 from magento-engcom/develop-prs
Public Pull Requests: #9932 #9905 #8879 #9525 #9251 #4891 #7758
2 parents 2c89e48 + 5d5690e commit ec99590

File tree

15 files changed

+69
-39
lines changed

15 files changed

+69
-39
lines changed

app/code/Magento/Catalog/etc/mview.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
<table name="catalog_product_entity_decimal" entity_column="entity_id" />
3737
<table name="catalog_product_entity_gallery" entity_column="entity_id" />
3838
<table name="catalog_product_entity_int" entity_column="entity_id" />
39-
<table name="catalog_product_entity_media_gallery" entity_column="value_id" />
4039
<table name="catalog_product_entity_media_gallery_value" entity_column="entity_id" />
4140
<table name="catalog_product_entity_text" entity_column="entity_id" />
4241
<table name="catalog_product_entity_tier_price" entity_column="entity_id" />

app/code/Magento/CatalogRule/etc/mview.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<table name="catalog_product_entity_decimal" entity_column="entity_id" />
1919
<table name="catalog_product_entity_gallery" entity_column="entity_id" />
2020
<table name="catalog_product_entity_int" entity_column="entity_id" />
21-
<table name="catalog_product_entity_media_gallery" entity_column="value_id" />
2221
<table name="catalog_product_entity_media_gallery_value" entity_column="entity_id" />
2322
<table name="catalog_product_entity_text" entity_column="entity_id" />
2423
<table name="catalog_product_entity_tier_price" entity_column="entity_id" />

app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ protected function getDefaultValue($attributeCode)
321321
return $this->getCustomer()->getFirstname();
322322
}
323323
break;
324+
case 'middlename':
325+
if ($this->getCustomer()) {
326+
return $this->getCustomer()->getMiddlename();
327+
}
328+
break;
324329
case 'lastname':
325330
if ($this->getCustomer()) {
326331
return $this->getCustomer()->getLastname();

app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
-->
77
<div class="billing-address-details" data-bind="if: isAddressDetailsVisible() && currentBillingAddress()">
8-
<!-- ko text: currentBillingAddress().prefix --><!-- /ko --> <!-- ko text: currentBillingAddress().firstname --><!-- /ko -->
8+
<!-- ko text: currentBillingAddress().prefix --><!-- /ko --> <!-- ko text: currentBillingAddress().firstname --><!-- /ko --> <!-- ko text: currentBillingAddress().middlename --><!-- /ko -->
99
<!-- ko text: currentBillingAddress().lastname --><!-- /ko --> <!-- ko text: currentBillingAddress().suffix --><!-- /ko --><br/>
1010
<!-- ko text: currentBillingAddress().street --><!-- /ko --><br/>
1111
<!-- ko text: currentBillingAddress().city --><!-- /ko -->, <span data-bind="html: currentBillingAddress().region"></span> <!-- ko text: currentBillingAddress().postcode --><!-- /ko --><br/>

app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
-->
77
<div class="shipping-address-item" data-bind="css: isSelected() ? 'selected-item' : 'not-selected-item'">
8-
<!-- ko text: address().prefix --><!-- /ko --> <!-- ko text: address().firstname --><!-- /ko -->
8+
<!-- ko text: address().prefix --><!-- /ko --> <!-- ko text: address().firstname --><!-- /ko --> <!-- ko text: address().middlename --><!-- /ko -->
99
<!-- ko text: address().lastname --><!-- /ko --> <!-- ko text: address().suffix --><!-- /ko --><br/>
1010
<!-- ko text: address().street --><!-- /ko --><br/>
1111
<!-- ko text: address().city --><!-- /ko -->, <span data-bind="html: address().region"></span> <!-- ko text: address().postcode --><!-- /ko --><br/>

app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
-->
77
<!-- ko if: (visible()) -->
8-
<!-- ko text: address().prefix --><!-- /ko --> <!-- ko text: address().firstname --><!-- /ko -->
8+
<!-- ko text: address().prefix --><!-- /ko --> <!-- ko text: address().firstname --><!-- /ko --> <!-- ko text: address().middlename --><!-- /ko -->
99
<!-- ko text: address().lastname --><!-- /ko --> <!-- ko text: address().suffix --><!-- /ko --><br/>
1010
<!-- ko text: address().street --><!-- /ko --><br/>
1111
<!-- ko text: address().city --><!-- /ko -->, <span data-bind="html: address().region"></span> <!-- ko text: address().postcode --><!-- /ko --><br/>

app/code/Magento/Eav/Setup/EavSetup.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ public function updateAttribute($entityTypeId, $id, $field, $value = null, $sort
942942
* @param mixed $value
943943
* @param int $sortOrder
944944
* @return $this
945+
* @throws LocalizedException
945946
*/
946947
private function _updateAttribute($entityTypeId, $id, $field, $value = null, $sortOrder = null)
947948
{
@@ -972,11 +973,15 @@ private function _updateAttribute($entityTypeId, $id, $field, $value = null, $so
972973
return $this;
973974
}
974975
}
976+
$attributeId = $this->getAttributeId($entityTypeId, $id);
977+
if (false === $attributeId) {
978+
throw new LocalizedException(__('Attribute with ID: "%1" does not exist', $id));
979+
}
975980

976981
$this->setup->updateTableRow(
977982
'eav_attribute',
978983
'attribute_id',
979-
$this->getAttributeId($entityTypeId, $id),
984+
$attributeId,
980985
$field,
981986
$value,
982987
'entity_type_id',
@@ -994,6 +999,7 @@ private function _updateAttribute($entityTypeId, $id, $field, $value = null, $so
994999
* @param string|array $field
9951000
* @param mixed $value
9961001
* @return $this
1002+
* @throws LocalizedException
9971003
*/
9981004
private function _updateAttributeAdditionalData($entityTypeId, $id, $field, $value = null)
9991005
{
@@ -1022,6 +1028,11 @@ private function _updateAttributeAdditionalData($entityTypeId, $id, $field, $val
10221028
return $this;
10231029
}
10241030
}
1031+
1032+
$attributeId = $this->getAttributeId($entityTypeId, $id);
1033+
if (false === $attributeId) {
1034+
throw new LocalizedException(__('Attribute with ID: "%1" does not exist', $id));
1035+
}
10251036
$this->setup->updateTableRow(
10261037
$this->setup->getTable($additionalTable),
10271038
'attribute_id',

app/code/Magento/GiftMessage/i18n/en_US.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ OK,OK
2222
"Gift Options","Gift Options"
2323
"Gift Message","Gift Message"
2424
"Do you have any gift items in your order?","Do you have any gift items in your order?"
25-
"Add gift options","Add gift options"
25+
"Add Gift Options","Add Gift Options"
2626
"Gift Options for the Entire Order","Gift Options for the Entire Order"
2727
"Leave this box blank if you don\'t want to leave a gift message for the entire order.","Leave this box blank if you don\'t want to leave a gift message for the entire order."
2828
"Gift Options for Individual Items","Gift Options for Individual Items"
2929
"<span>Item %1</span> of %2","<span>Item %1</span> of %2"
3030
"Leave a box blank if you don\'t want to add a gift message for that item.","Leave a box blank if you don\'t want to add a gift message for that item."
3131
"Add Gift Options for the Entire Order","Add Gift Options for the Entire Order"
3232
"You can leave this box blank if you don\'t want to add a gift message for this address.","You can leave this box blank if you don\'t want to add a gift message for this address."
33-
"Add gift options for Individual Items","Add gift options for Individual Items"
33+
"Add Gift Options for Individual Items","Add Gift Options for Individual Items"
3434
"You can leave this box blank if you don\'t want to add a gift message for the item.","You can leave this box blank if you don\'t want to add a gift message for the item."
3535
"Gift Message (optional)","Gift Message (optional)"
3636
To:,To:
3737
From:,From:
3838
Message:,Message:
3939
Update,Update
40-
"Gift options","Gift options"
40+
"Gift Options","Gift Options"
4141
Edit,Edit
4242
Delete,Delete
4343
"Allow Gift Messages on Order Level","Allow Gift Messages on Order Level"

app/code/Magento/GiftMessage/view/frontend/templates/inline.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<div class="field choice" id="add-gift-options-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>">
1616
<input type="checkbox" name="allow_gift_options" id="allow_gift_options" data-mage-init='{"giftOptions":{}}' value="1" data-selector='{"id":"#allow-gift-options-container"}'<?php if ($block->getItemsHasMesssages() || $block->getEntityHasMessage()): ?> checked="checked"<?php endif; ?> class="checkbox" />
17-
<label for="allow_gift_options" class="label"><span><?php /* @escapeNotVerified */ echo __('Add gift options') ?></span></label>
17+
<label for="allow_gift_options" class="label"><span><?php /* @escapeNotVerified */ echo __('Add Gift Options') ?></span></label>
1818
</div>
1919

2020
<dl class="options-items" id="allow-gift-options-container">
@@ -148,7 +148,7 @@
148148

149149
<div class="field choice" id="add-gift-options-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>">
150150
<input type="checkbox" name="allow_gift_options_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>" id="allow_gift_options_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>" data-mage-init='{"giftOptions":{}}' value="1" data-selector='{"id":"#allow-gift-options-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>"}'<?php if ($block->getItemsHasMesssages() || $block->getEntityHasMessage()): ?> checked="checked"<?php endif; ?> class="checkbox" />
151-
<label for="allow_gift_options_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>" class="label"><span><?php /* @escapeNotVerified */ echo __('Add gift options') ?></span></label>
151+
<label for="allow_gift_options_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>" class="label"><span><?php /* @escapeNotVerified */ echo __('Add Gift Options') ?></span></label>
152152
</div>
153153

154154
<dl class="options-items" id="allow-gift-options-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>">
@@ -197,7 +197,7 @@
197197
<dt id="add-gift-options-for-items-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>" class="order-title individual">
198198
<div class="field choice">
199199
<input type="checkbox" name="allow_gift_options_for_items_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>" id="allow_gift_options_for_items_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>" data-mage-init='{"giftOptions":{}}' value="1" data-selector='{"id":"#allow-gift-options-for-items-container-<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>"}'<?php if ($block->getItemsHasMesssages()): ?> checked="checked"<?php endif; ?> class="checkbox" />
200-
<label for="allow_gift_options_for_items_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>" class="label"><span><?php /* @escapeNotVerified */ echo __('Add gift options for Individual Items') ?></span></label>
200+
<label for="allow_gift_options_for_items_<?php /* @escapeNotVerified */ echo $block->getEntity()->getId() ?>" class="label"><span><?php /* @escapeNotVerified */ echo __('Add Gift Options for Individual Items') ?></span></label>
201201
</div>
202202
</dt>
203203

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Shipping extends Form
3737
protected $shippingMethod = '//span[text()="%s"]/following::label[contains(., "%s")]/../input';
3838

3939
/**
40-
* From with shipping available shipping methods.
40+
* Form with shipping available shipping methods.
4141
*
4242
* @var string
4343
*/

dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ private function validateComposerJsonFile($path)
9999
/** @var \Magento\Framework\Composer\MagentoComposerApplicationFactory $appFactory */
100100
$appFactory = self::$objectManager->get(\Magento\Framework\Composer\MagentoComposerApplicationFactory::class);
101101
$app = $appFactory->create();
102-
$app->runComposerCommand(['command' => 'validate'], $path);
102+
103+
try {
104+
$app->runComposerCommand(['command' => 'validate'], $path);
105+
} catch (\RuntimeException $exception) {
106+
$this->fail($exception->getMessage());
107+
}
103108
}
104109

105110
/**

lib/internal/Magento/Framework/Validator/Builder.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* See COPYING.txt for license details.
77
*/
88

9-
// @codingStandardsIgnoreFile
10-
119
namespace Magento\Framework\Validator;
1210

1311
use Magento\Framework\Validator\Constraint\OptionInterface;
@@ -257,7 +255,11 @@ protected function _createConstraint(array $data)
257255
}
258256

259257
if (\Magento\Framework\Validator\Config::CONSTRAINT_TYPE_PROPERTY == $data['type']) {
260-
$result = new \Magento\Framework\Validator\Constraint\Property($validator, $data['property'], $data['alias']);
258+
$result = new \Magento\Framework\Validator\Constraint\Property(
259+
$validator,
260+
$data['property'],
261+
$data['alias']
262+
);
261263
} else {
262264
$result = $this->_constraintFactory->create(['validator' => $validator, 'alias' => $data['alias']]);
263265
}
@@ -286,7 +288,10 @@ protected function _createConstraintValidator(array $data)
286288
// Check validator type
287289
if (!$validator instanceof \Magento\Framework\Validator\ValidatorInterface) {
288290
throw new \InvalidArgumentException(
289-
sprintf('Constraint class "%s" must implement \Magento\Framework\Validator\ValidatorInterface', $data['class'])
291+
sprintf(
292+
'Constraint class "%s" must implement \Magento\Framework\Validator\ValidatorInterface',
293+
$data['class']
294+
)
290295
);
291296
}
292297

@@ -300,8 +305,10 @@ protected function _createConstraintValidator(array $data)
300305
* @param array $options
301306
* @return void
302307
*/
303-
protected function _configureConstraintValidator(\Magento\Framework\Validator\ValidatorInterface $validator, array $options)
304-
{
308+
protected function _configureConstraintValidator(
309+
\Magento\Framework\Validator\ValidatorInterface $validator,
310+
array $options
311+
) {
305312
// Call all validator methods according to configuration
306313
if (isset($options['methods'])) {
307314
foreach ($options['methods'] as $methodData) {

lib/internal/Magento/Framework/Validator/Constraint/Property.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* See COPYING.txt for license details.
77
*/
88

9-
// @codingStandardsIgnoreFile
10-
119
namespace Magento\Framework\Validator\Constraint;
1210

1311
class Property extends \Magento\Framework\Validator\Constraint
@@ -33,8 +31,8 @@ public function __construct(\Magento\Framework\Validator\ValidatorInterface $val
3331
}
3432

3533
/**
36-
* Get value that should be validated. Tries to extract value's property if \Magento\Framework\DataObject or \ArrayAccess or array
37-
* is passed
34+
* Get value that should be validated. Tries to extract value's property if \Magento\Framework\DataObject or
35+
* \ArrayAccess or array is passed
3836
*
3937
* @param mixed $value
4038
* @return mixed

lib/internal/Magento/Framework/Validator/ConstraintFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* Factory class for \Magento\Framework\Validator\Constraint
119
*/
@@ -33,8 +31,10 @@ class ConstraintFactory
3331
* @param \Magento\Framework\ObjectManagerInterface $objectManager
3432
* @param string $instanceName
3533
*/
36-
public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, $instanceName = \Magento\Framework\Validator\Constraint::class)
37-
{
34+
public function __construct(
35+
\Magento\Framework\ObjectManagerInterface $objectManager,
36+
$instanceName = \Magento\Framework\Validator\Constraint::class
37+
) {
3838
$this->_objectManager = $objectManager;
3939
$this->_instanceName = $instanceName;
4040
}

lib/internal/Magento/Framework/Validator/Factory.php

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Framework\Validator;
78

89
use Magento\Framework\Cache\FrontendInterface;
910

10-
/**
11-
* @codingStandardsIgnoreFile
12-
*/
1311
class Factory
1412
{
15-
/**
16-
* Cache key
17-
*/
13+
/** cache key */
1814
const CACHE_KEY = __CLASS__;
1915

2016
/**
@@ -73,14 +69,19 @@ public function __construct(
7369

7470
/**
7571
* Init cached list of validation files
72+
*
73+
* @return void
7674
*/
7775
protected function _initializeConfigList()
7876
{
7977
if (!$this->_configFiles) {
8078
$this->_configFiles = $this->cache->load(self::CACHE_KEY);
8179
if (!$this->_configFiles) {
8280
$this->_configFiles = $this->moduleReader->getConfigurationFiles('validation.xml');
83-
$this->cache->save($this->getSerializer()->serialize($this->_configFiles->toArray()), self::CACHE_KEY);
81+
$this->cache->save(
82+
$this->getSerializer()->serialize($this->_configFiles->toArray()),
83+
self::CACHE_KEY
84+
);
8485
} else {
8586
$filesArray = $this->getSerializer()->unserialize($this->_configFiles);
8687
$this->_configFiles = $this->getFileIteratorFactory()->create(array_keys($filesArray));
@@ -121,7 +122,9 @@ public function getValidatorConfig()
121122
$this->_initializeConfigList();
122123
$this->_initializeDefaultTranslator();
123124
return $this->_objectManager->create(
124-
\Magento\Framework\Validator\Config::class, ['configFiles' => $this->_configFiles]);
125+
\Magento\Framework\Validator\Config::class,
126+
['configFiles' => $this->_configFiles]
127+
);
125128
}
126129

127130
/**
@@ -161,7 +164,9 @@ public function createValidator($entityName, $groupName, array $builderConfig =
161164
private function getSerializer()
162165
{
163166
if ($this->serializer === null) {
164-
$this->serializer = $this->_objectManager->get(\Magento\Framework\Serialize\SerializerInterface::class);
167+
$this->serializer = $this->_objectManager->get(
168+
\Magento\Framework\Serialize\SerializerInterface::class
169+
);
165170
}
166171
return $this->serializer;
167172
}
@@ -175,8 +180,9 @@ private function getSerializer()
175180
private function getFileIteratorFactory()
176181
{
177182
if ($this->fileIteratorFactory === null) {
178-
$this->fileIteratorFactory = $this->_objectManager
179-
->get(\Magento\Framework\Config\FileIteratorFactory::class);
183+
$this->fileIteratorFactory = $this->_objectManager->get(
184+
\Magento\Framework\Config\FileIteratorFactory::class
185+
);
180186
}
181187
return $this->fileIteratorFactory;
182188
}

0 commit comments

Comments
 (0)