Skip to content

Commit 4fd3d67

Browse files
committed
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-87589
2 parents cc8e82e + b33721c commit 4fd3d67

File tree

84 files changed

+137
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+137
-98
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
*/
77
namespace Magento\Catalog\Controller\Adminhtml\Product\Set;
88

9+
use Magento\Framework\App\ObjectManager;
10+
11+
/**
12+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
13+
*/
914
class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Set
1015
{
1116
/**
@@ -17,22 +22,49 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Set
1722
* @var \Magento\Framework\Controller\Result\JsonFactory
1823
*/
1924
protected $resultJsonFactory;
20-
25+
26+
/*
27+
* @var \Magento\Eav\Model\Entity\Attribute\SetFactory
28+
*/
29+
private $attributeSetFactory;
30+
31+
/*
32+
* @var \Magento\Framework\Filter\FilterManager
33+
*/
34+
private $filterManager;
35+
36+
/*
37+
* @var \Magento\Framework\Json\Helper\Data
38+
*/
39+
private $jsonHelper;
40+
2141
/**
2242
* @param \Magento\Backend\App\Action\Context $context
2343
* @param \Magento\Framework\Registry $coreRegistry
2444
* @param \Magento\Framework\View\LayoutFactory $layoutFactory
2545
* @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
46+
* @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory
47+
* @param \Magento\Framework\Filter\FilterManager $filterManager
48+
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
2649
*/
2750
public function __construct(
2851
\Magento\Backend\App\Action\Context $context,
2952
\Magento\Framework\Registry $coreRegistry,
3053
\Magento\Framework\View\LayoutFactory $layoutFactory,
31-
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
54+
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
55+
\Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory = null,
56+
\Magento\Framework\Filter\FilterManager $filterManager = null,
57+
\Magento\Framework\Json\Helper\Data $jsonHelper = null
3258
) {
3359
parent::__construct($context, $coreRegistry);
3460
$this->layoutFactory = $layoutFactory;
3561
$this->resultJsonFactory = $resultJsonFactory;
62+
$this->attributeSetFactory = $attributeSetFactory ?: ObjectManager::getInstance()
63+
->get(\Magento\Eav\Model\Entity\Attribute\SetFactory::class);
64+
$this->filterManager = $filterManager ?: ObjectManager::getInstance()
65+
->get(\Magento\Framework\Filter\FilterManager::class);
66+
$this->jsonHelper = $jsonHelper ?: ObjectManager::getInstance()
67+
->get(\Magento\Framework\Json\Helper\Data::class);
3668
}
3769

3870
/**
@@ -65,16 +97,12 @@ public function execute()
6597
$isNewSet = $this->getRequest()->getParam('gotoEdit', false) == '1';
6698

6799
/* @var $model \Magento\Eav\Model\Entity\Attribute\Set */
68-
$model = $this->_objectManager->create(\Magento\Eav\Model\Entity\Attribute\Set::class)
69-
->setEntityTypeId($entityTypeId);
70-
71-
/** @var $filterManager \Magento\Framework\Filter\FilterManager */
72-
$filterManager = $this->_objectManager->get(\Magento\Framework\Filter\FilterManager::class);
100+
$model = $this->attributeSetFactory->create()->setEntityTypeId($entityTypeId);
73101

74102
try {
75103
if ($isNewSet) {
76104
//filter html tags
77-
$name = $filterManager->stripTags($this->getRequest()->getParam('attribute_set_name'));
105+
$name = $this->filterManager->stripTags($this->getRequest()->getParam('attribute_set_name'));
78106
$model->setAttributeSetName(trim($name));
79107
} else {
80108
if ($attributeSetId) {
@@ -85,11 +113,10 @@ public function execute()
85113
__('This attribute set no longer exists.')
86114
);
87115
}
88-
$data = $this->_objectManager->get(\Magento\Framework\Json\Helper\Data::class)
89-
->jsonDecode($this->getRequest()->getPost('data'));
116+
$data = $this->jsonHelper->jsonDecode($this->getRequest()->getPost('data'));
90117

91118
//filter html tags
92-
$data['attribute_set_name'] = $filterManager->stripTags($data['attribute_set_name']);
119+
$data['attribute_set_name'] = $this->filterManager->stripTags($data['attribute_set_name']);
93120

94121
$model->organizeData($data);
95122
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2675,7 +2675,12 @@ protected function checkUrlKeyDuplicates()
26752675
);
26762676
foreach ($urlKeyDuplicates as $entityData) {
26772677
$rowNum = $this->rowNumbers[$entityData['store_id']][$entityData['request_path']];
2678-
$this->addRowError(ValidatorInterface::ERROR_DUPLICATE_URL_KEY, $rowNum);
2678+
$message = sprintf(
2679+
$this->retrieveMessageTemplate(ValidatorInterface::ERROR_DUPLICATE_URL_KEY),
2680+
$entityData['request_path'],
2681+
$entityData['sku']
2682+
);
2683+
$this->addRowError(ValidatorInterface::ERROR_DUPLICATE_URL_KEY, $rowNum, 'url_key', $message);
26792684
}
26802685
}
26812686
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,5 @@ Payment,Payment
176176
"Not yet calculated","Not yet calculated"
177177
"We received your order!","We received your order!"
178178
"Thank you for your purchase!","Thank you for your purchase!"
179-
"optional", "optional"
179+
"Password", "Password"
180180
"Something went wrong while saving the page. Please refresh the page and try again.","Something went wrong while saving the page. Please refresh the page and try again."

app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<input class="input-text"
4242
data-bind="
4343
attr: {
44-
placeholder: $t('optional'),
44+
placeholder: $t('Password'),
4545
}"
4646
type="password"
4747
name="password"

app/code/Magento/Newsletter/Block/Adminhtml/Problem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Problem extends \Magento\Backend\Block\Template
1919
/**
2020
* @var string
2121
*/
22-
protected $_template = 'problem/list.phtml';
22+
protected $_template = 'Magento_Newsletter::problem/list.phtml';
2323

2424
/**
2525
* @var \Magento\Newsletter\Model\ResourceModel\Problem\Collection

app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Edit extends \Magento\Backend\Block\Template
1919
/**
2020
* @var string
2121
*/
22-
protected $_template = 'queue/edit.phtml';
22+
protected $_template = 'Magento_Newsletter::queue/edit.phtml';
2323

2424
/**
2525
* Core registry

app/code/Magento/Newsletter/Block/Adminhtml/Subscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Subscriber extends \Magento\Backend\Block\Template
2929
/**
3030
* @var string
3131
*/
32-
protected $_template = 'subscriber/list.phtml';
32+
protected $_template = 'Magento_Newsletter::subscriber/list.phtml';
3333

3434
/**
3535
* @var \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory

app/code/Magento/Newsletter/Block/Adminhtml/Template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Template extends \Magento\Backend\Block\Template
1616
/**
1717
* @var string
1818
*/
19-
protected $_template = 'template/list.phtml';
19+
protected $_template = 'Magento_Newsletter::template/list.phtml';
2020

2121
/**
2222
* @return $this

app/code/Magento/OfflinePayments/Block/Form/Banktransfer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ class Banktransfer extends \Magento\OfflinePayments\Block\Form\AbstractInstructi
1515
*
1616
* @var string
1717
*/
18-
protected $_template = 'form/banktransfer.phtml';
18+
protected $_template = 'Magento_OfflinePayments::form/banktransfer.phtml';
1919
}

app/code/Magento/OfflinePayments/Block/Form/Cashondelivery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ class Cashondelivery extends \Magento\OfflinePayments\Block\Form\AbstractInstruc
1515
*
1616
* @var string
1717
*/
18-
protected $_template = 'form/cashondelivery.phtml';
18+
protected $_template = 'Magento_OfflinePayments::form/cashondelivery.phtml';
1919
}

0 commit comments

Comments
 (0)