Skip to content

Commit 54d065a

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #17056: [Forwardport] Add generated code to the psr-0 autoloader section so when optimizing� (by @torhoehn) - #17049: [Forwardport] Log when Magento is in maintenance mode (by @torhoehn) - #17044: [Forwardport] Update nginx.config.sample to exclude php5-fpm (by @torhoehn) - #17054: [Forwardport] Remove extra spaces from Magento/Ui (by @torhoehn) - #17060: [Forwardport] fix: add hasrequired notice for create account form and password forg� (by @DanielRuf) - #17042: [Forwardport] Remove direct use of object manager (by @torhoehn) - #16956: [Forwardport] Trim issue on customer confirmation form (by @gelanivishal) - magento-engcom/import-export-improvements#117: magento-engcom/import-export-improvements#103 Fail product import validation when multiselect columns contain duplicate values (by @pogster) - #17043: [Forwardport] Add Clean Code (by @torhoehn) - #17046: [Forwardport] Remove duplicated string. (by @torhoehn) Fixed GitHub Issues: - #6058: IE11 user login email validation fails if field has leading or trailing space (reported by @dnadle) has been fixed in #16956 by @gelanivishal in 2.3-develop branch Related commits: 1. f3502da 2. 9d15ecc 3. 6897f27 - #103: Phoenix/Moneybookers (reported by @riconeitzel) has been fixed in magento-engcom/import-export-improvements#117 by @pogster in 2.3-develop branch Related commits: 1. a765ec7 2. d45e4f8
2 parents a02fa7c + cba0ec0 commit 54d065a

File tree

21 files changed

+130
-33
lines changed

21 files changed

+130
-33
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
294294
ValidatorInterface::ERROR_MEDIA_PATH_NOT_ACCESSIBLE => 'Imported resource (image) does not exist in the local media storage',
295295
ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE => 'Imported resource (image) could not be downloaded from external resource due to timeout or access permissions',
296296
ValidatorInterface::ERROR_INVALID_WEIGHT => 'Product weight is invalid',
297-
ValidatorInterface::ERROR_DUPLICATE_URL_KEY => 'Url key: \'%s\' was already generated for an item with the SKU: \'%s\'. You need to specify the unique URL key manually'
297+
ValidatorInterface::ERROR_DUPLICATE_URL_KEY => 'Url key: \'%s\' was already generated for an item with the SKU: \'%s\'. You need to specify the unique URL key manually',
298+
ValidatorInterface::ERROR_DUPLICATE_MULTISELECT_VALUES => "Value for multiselect attribute %s contains duplicated values",
298299
];
299300
//@codingStandardsIgnoreEnd
300301

app/code/Magento/CatalogImportExport/Model/Import/Product/RowValidatorInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ interface RowValidatorInterface extends \Magento\Framework\Validator\ValidatorIn
8585

8686
const ERROR_DUPLICATE_URL_KEY = 'duplicatedUrlKey';
8787

88+
const ERROR_DUPLICATE_MULTISELECT_VALUES = 'duplicatedMultiselectValues';
89+
8890
/**
8991
* Value that means all entities (e.g. websites, groups etc.)
9092
*/

app/code/Magento/CatalogImportExport/Model/Import/Product/Validator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ public function isAttributeValid($attrCode, array $attrParams, array $rowData)
219219
break;
220220
}
221221
}
222+
223+
$uniqueValues = array_unique($values);
224+
if (count($uniqueValues) != count($values)) {
225+
$valid = false;
226+
$this->_addMessages([RowValidatorInterface::ERROR_DUPLICATE_MULTISELECT_VALUES]);
227+
}
222228
break;
223229
case 'datetime':
224230
$val = trim($rowData[$attrCode]);

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/ValidatorTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,26 @@ public function attributeValidationProvider()
167167
['product_type' => 'any', 'attribute_code' => 'Option 1|Option 2'],
168168
true
169169
],
170+
[
171+
Import::BEHAVIOR_APPEND,
172+
['is_required' => true, 'type' => 'multiselect',
173+
'options' => ['option 1' => 0, 'option 2' => 1, 'option 3']],
174+
['product_type' => 'any', 'attribute_code' => 'Option 1|Option 2|Option 1'],
175+
false
176+
],
177+
[
178+
Import::BEHAVIOR_APPEND,
179+
['is_required' => true, 'type' => 'multiselect',
180+
'options' => ['option 1' => 0, 'option 2' => 1, 'option 3']],
181+
['product_type' => 'any', 'attribute_code' => 'Option 3|Option 3|Option 3|Option 1'],
182+
false
183+
],
184+
[
185+
Import::BEHAVIOR_APPEND,
186+
['is_required' => true, 'type' => 'multiselect', 'options' => ['option 1' => 0]],
187+
['product_type' => 'any', 'attribute_code' => 'Option 1|Option 1|Option 1|Option 1'],
188+
false
189+
],
170190
[
171191
Import::BEHAVIOR_APPEND,
172192
['is_required' => true, 'type' => 'datetime'],

app/code/Magento/CatalogRule/Model/Rule/Job.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
* See COPYING.txt for license details.
99
*/
1010

11+
namespace Magento\CatalogRule\Model\Rule;
12+
13+
use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor;
14+
1115
/**
1216
* Catalog Rule job model
1317
*
@@ -18,13 +22,8 @@
1822
* @method bool hasSuccess()
1923
* @method bool hasError()
2024
*
21-
* @author Magento Core Team <[email protected]>
22-
*/
23-
namespace Magento\CatalogRule\Model\Rule;
24-
25-
use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor;
26-
27-
/**
25+
* @author Magento Core Team <[email protected]>
26+
*
2827
* @api
2928
* @since 100.0.2
3029
*/
@@ -39,10 +38,14 @@ class Job extends \Magento\Framework\DataObject
3938
* Basic object initialization
4039
*
4140
* @param RuleProductProcessor $ruleProcessor
41+
* @param array $data
4242
*/
43-
public function __construct(RuleProductProcessor $ruleProcessor)
44-
{
43+
public function __construct(
44+
RuleProductProcessor $ruleProcessor,
45+
array $data = []
46+
) {
4547
$this->ruleProcessor = $ruleProcessor;
48+
parent::__construct($data);
4649
}
4750

4851
/**

app/code/Magento/Customer/view/frontend/templates/form/confirmation.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="field email required">
1515
<label for="email_address" class="label"><span><?= $block->escapeHtml(__('Email')) ?></span></label>
1616
<div class="control">
17-
<input type="email" name="email" id="email_address" class="input-text" value="<?= $block->escapeHtmlAttr($block->getEmail()) ?>" data-validate="{required:true, 'validate-email':true}">
17+
<input type="email" name="email" id="email_address" class="input-text" value="<?= $block->escapeHtmlAttr($block->getEmail()) ?>" data-validate="{required:true, 'validate-email':true}" data-mage-init='{"mage/trim-input":{}}'>
1818
</div>
1919
</div>
2020
</fieldset>

app/code/Magento/GroupedProduct/Model/Product/Initialization/Helper/ProductLinks/Plugin/Grouped.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Catalog\Api\Data\ProductLinkExtensionFactory;
99
use Magento\Catalog\Api\Data\ProductLinkInterfaceFactory;
1010
use Magento\Catalog\Api\ProductRepositoryInterface;
11+
use Magento\Framework\Exception\NoSuchEntityException;
1112
use Magento\GroupedProduct\Model\Product\Type\Grouped as TypeGrouped;
1213

1314
/**
@@ -60,6 +61,9 @@ public function __construct(
6061
* @param array $links
6162
*
6263
* @return \Magento\Catalog\Model\Product
64+
*
65+
* @throws NoSuchEntityException
66+
*
6367
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
6468
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
6569
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -70,7 +74,7 @@ public function beforeInitializeLinks(
7074
array $links
7175
) {
7276
if ($product->getTypeId() === TypeGrouped::TYPE_CODE && !$product->getGroupedReadonly()) {
73-
$links = (isset($links[self::TYPE_NAME])) ? $links[self::TYPE_NAME] : $product->getGroupedLinkData();
77+
$links = $links[self::TYPE_NAME] ?? $product->getGroupedLinkData();
7478
if (!is_array($links)) {
7579
$links = [];
7680
}

app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber/MassDelete.php

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,32 @@
66
*/
77
namespace Magento\Newsletter\Controller\Adminhtml\Subscriber;
88

9-
class MassDelete extends \Magento\Newsletter\Controller\Adminhtml\Subscriber
9+
use Magento\Newsletter\Controller\Adminhtml\Subscriber;
10+
use Magento\Backend\App\Action\Context;
11+
use Magento\Framework\App\Response\Http\FileFactory;
12+
use Magento\Newsletter\Model\SubscriberFactory;
13+
use Magento\Framework\App\ObjectManager;
14+
15+
class MassDelete extends Subscriber
1016
{
17+
/**
18+
* @var SubscriberFactory
19+
*/
20+
private $subscriberFactory;
21+
22+
/**
23+
* @param Context $context
24+
* @param FileFactory $fileFactory
25+
*/
26+
public function __construct(
27+
Context $context,
28+
FileFactory $fileFactory,
29+
SubscriberFactory $subscriberFactory = null
30+
) {
31+
$this->subscriberFactory = $subscriberFactory ?: ObjectManager::getInstance()->get(SubscriberFactory::class);
32+
parent::__construct($context, $fileFactory);
33+
}
34+
1135
/**
1236
* Delete one or more subscribers action
1337
*
@@ -21,9 +45,7 @@ public function execute()
2145
} else {
2246
try {
2347
foreach ($subscribersIds as $subscriberId) {
24-
$subscriber = $this->_objectManager->create(
25-
\Magento\Newsletter\Model\Subscriber::class
26-
)->load(
48+
$subscriber = $this->subscriberFactory->create()->load(
2749
$subscriberId
2850
);
2951
$subscriber->delete();

app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber/MassUnsubscribe.php

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,33 @@
66
*/
77
namespace Magento\Newsletter\Controller\Adminhtml\Subscriber;
88

9-
class MassUnsubscribe extends \Magento\Newsletter\Controller\Adminhtml\Subscriber
9+
use Magento\Newsletter\Controller\Adminhtml\Subscriber;
10+
use Magento\Backend\App\Action\Context;
11+
use Magento\Framework\App\Response\Http\FileFactory;
12+
use Magento\Newsletter\Model\SubscriberFactory;
13+
use Magento\Framework\App\ObjectManager;
14+
15+
class MassUnsubscribe extends Subscriber
1016
{
17+
/**
18+
* @var SubscriberFactory
19+
*/
20+
private $subscriberFactory;
21+
22+
/**
23+
* @param Context $context
24+
* @param FileFactory $fileFactory
25+
* @param SubscriberFactory $subscriberFactory
26+
*/
27+
public function __construct(
28+
Context $context,
29+
FileFactory $fileFactory,
30+
SubscriberFactory $subscriberFactory = null
31+
) {
32+
$this->subscriberFactory = $subscriberFactory ?: ObjectManager::getInstance()->get(SubscriberFactory::class);
33+
parent::__construct($context, $fileFactory);
34+
}
35+
1136
/**
1237
* Unsubscribe one or more subscribers action
1338
*
@@ -21,9 +46,7 @@ public function execute()
2146
} else {
2247
try {
2348
foreach ($subscribersIds as $subscriberId) {
24-
$subscriber = $this->_objectManager->create(
25-
\Magento\Newsletter\Model\Subscriber::class
26-
)->load(
49+
$subscriber = $this->subscriberFactory->create()->load(
2750
$subscriberId
2851
);
2952
$subscriber->unsubscribe();

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ Delete,Delete
4040
"Autostart base video","Autostart base video"
4141
"Show related video","Show related video"
4242
"Auto restart video","Auto restart video"
43-
"Images And Videos","Images And Videos"

app/code/Magento/Ui/view/base/web/templates/form/components/collection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<legend class="admin__legend">
3131
<span text="$parent.label"/>
3232
</legend><br />
33-
33+
3434
<each args="getRegion('body')" render=""/>
3535
</fieldset>
3636
</div>

app/code/Magento/Ui/view/base/web/templates/form/element/checkbox-set.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
<div class="admin__field-control"
1717
css="'_with-tooltip': $data.tooltip">
1818
<div class="admin__field admin__field-option" outereach="options">
19-
<input
19+
<input
2020
ko-checked="$parent.value"
2121
ko-disabled="$parent.disabled"
2222
css="
2323
'admin__control-radio': !$parent.multiple,
2424
'admin__control-checkbox': $parent.multiple"
2525
attr="
26-
id: ++ko.uid,
26+
id: ++ko.uid,
2727
value: value,
2828
type: $parent.multiple ? 'checkbox' : 'radio'"/>
2929

app/code/Magento/Ui/view/base/web/templates/form/field.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<div class="admin__field-note" if="$data.notice" attr="id: noticeId">
3636
<span translate="notice"/>
3737
</div>
38-
38+
3939
<div class="admin__additional-info" if="$data.additionalInfo" html="$data.additionalInfo"></div>
4040

4141
<render args="$data.service.template" if="$data.hasService()"/>

app/code/Magento/Ui/view/base/web/templates/grid/editing/bulk.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</button>
1414
</with>
1515
</if>
16-
16+
1717
<if args="$data.isEditor">
1818
<label class="admin__field-label admin__field-label-vertical" attr="for: uid" translate="'All in Column'"/>
1919
<render/>

app/code/Magento/Ui/view/base/web/templates/grid/editing/row.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<span class="data-grid-row-changed" css="_changed: $parent.hasChanges">
1212
<span class="data-grid-row-changed-tooltip" translate="'Record contains unsaved changes.'"/>
1313
</span>
14-
</td>
15-
14+
</td>
15+
1616
<!-- ko ifnot: $parent.isActionsColumn($data) -->
1717
<td if="$col.isEditor" template="$parent.fieldTmpl"/>
1818
<td ifnot="$col.isEditor" css="$col.getFieldClass()" template="$col.getBody()"/>

app/code/Magento/Ui/view/base/web/templates/grid/sticky/sticky.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div style="display: none;" css="stickyClass" afterRender="setStickyNode">
88
<span class="data-grid-cap-left" afterRender="setLeftCap"/>
99
<span class="data-grid-cap-right" afterRender="setRightCap"/>
10-
10+
1111
<div afterRender="setStickyToolbarNode">
1212
<div class="admin__data-grid-header">
1313
<div class="admin__data-grid-header-row">

app/code/Magento/Ui/view/base/web/templates/group/group.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<render args="elementTmpl" if="element.input_type == 'checkbox' || element.input_type == 'radio'"/>
2020
</if>
2121
</each>
22-
22+
2323
<each args="getRegion('insideGroup')" render=""/>
2424

2525
<each args="elems" if="validateWholeGroup">

app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@
9393
}
9494
}
9595
}
96+
.fieldset.create.account {
97+
.lib-form-hasrequired(bottom);
98+
&:after {
99+
margin-top: 35px;
100+
}
101+
}
102+
}
103+
104+
.form.password.forget {
105+
.fieldset {
106+
.lib-form-hasrequired(bottom);
107+
&:after {
108+
margin-top: 35px;
109+
}
110+
}
96111
}
97112

98113
// Full name fieldset

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@
278278
},
279279
"psr-0": {
280280
"": [
281-
"app/code/"
281+
"app/code/",
282+
"generated/code/"
282283
]
283284
},
284285
"files": [

lib/internal/Magento/Framework/App/Bootstrap.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\Autoload\Populator;
1313
use Magento\Framework\Config\File\ConfigFilePool;
1414
use Magento\Framework\Filesystem\DriverPool;
15+
use Psr\Log\LoggerInterface;
1516

1617
/**
1718
* A bootstrap of Magento application
@@ -258,6 +259,7 @@ public function run(AppInterface $application)
258259
\Magento\Framework\Profiler::stop('magento');
259260
} catch (\Exception $e) {
260261
\Magento\Framework\Profiler::stop('magento');
262+
$this->objectManager->get(LoggerInterface::class)->error($e->getMessage());
261263
if (!$application->catchException($this, $e)) {
262264
throw $e;
263265
}
@@ -423,7 +425,7 @@ protected function terminate(\Exception $e)
423425
if (!$this->objectManager) {
424426
throw new \DomainException();
425427
}
426-
$this->objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
428+
$this->objectManager->get(LoggerInterface::class)->critical($e);
427429
} catch (\Exception $e) {
428430
$message .= "Could not write error message to log. Please use developer mode to see the message.\n";
429431
}

nginx.conf.sample

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# # use tcp connection
44
# # server 127.0.0.1:9000;
55
# # or socket
6-
# server unix:/var/run/php5-fpm.sock;
76
# server unix:/var/run/php/php7.0-fpm.sock;
87
# }
98
# server {

0 commit comments

Comments
 (0)