Skip to content

Commit 6ad756f

Browse files
author
Hayder Sharhan
committed
Merge remote-tracking branch 'api/for-pr' into for-pr
2 parents 9f35dfb + 7be4512 commit 6ad756f

File tree

171 files changed

+1874
-1058
lines changed

Some content is hidden

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

171 files changed

+1874
-1058
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ protected function _toOptionHtml($action, \Magento\Framework\DataObject $row)
8282
$actionCaption = '';
8383
$this->_transformActionData($action, $actionCaption, $row);
8484

85-
$htmlAttibutes = ['value' => $this->escapeHtml($this->_jsonEncoder->encode($action))];
86-
$actionAttributes->setData($htmlAttibutes);
85+
$htmlAttributes = ['value' => $this->escapeHtml($this->_jsonEncoder->encode($action))];
86+
$actionAttributes->setData($htmlAttributes);
8787
return '<option ' . $actionAttributes->serialize() . '>' . $actionCaption . '</option>';
8888
}
8989

app/code/Magento/Backend/view/adminhtml/templates/store/switcher/form/renderer/fieldset.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<?php else: ?>
2626
<?php echo $block->getHintHtml() ?>
2727
<?php endif; ?>
28-
<div class="tree-store-scope">
28+
<div class="admin__fieldset tree-store-scope">
2929
<?php if ($_element->getComment()): ?>
3030
<p class="comment"><?php echo $block->escapeHtml($_element->getComment()) ?></p>
3131
<?php endif; ?>

app/code/Magento/Braintree/view/frontend/web/template/payment/form.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,26 +105,24 @@
105105
</div>
106106
<!-- /ko -->
107107
<!-- ko if: (isVaultEnabled())-->
108-
<div class="field">
108+
<div class="field choice">
109109
<input type="checkbox"
110110
name="vault[is_enabled]"
111-
class="checkbox-inline"
111+
class="checkbox"
112112
data-bind="attr: {'id': getCode() + '_vault_enabler'}, checked: vaultEnabler.isActivePaymentTokenEnabler"/>
113113
<label class="label" data-bind="attr: {'for': getCode() + '_vault_enabler'}">
114114
<span><!-- ko i18n: 'Save for later use.'--><!-- /ko --></span>
115115
</label>
116-
<div class="control _with-tooltip">
117-
<div class="field-tooltip toggle">
116+
<div class="field-tooltip toggle">
118117
<span class="field-tooltip-action action-vault"
119118
tabindex="0"
120119
data-toggle="dropdown"
121120
data-bind="attr: {title: $t('What is this?')}, mageInit: {'dropdown':{'activeClass': '_active'}}">
122121
<span translate="'What is this?'"></span>
123122
</span>
124-
<div class="field-tooltip-content"
125-
data-target="dropdown"
126-
translate="'We store you payment information securely on Braintree servers via SSL.'"></div>
127-
</div>
123+
<div class="field-tooltip-content"
124+
data-target="dropdown"
125+
translate="'We store you payment information securely on Braintree servers via SSL.'"></div>
128126
</div>
129127
</div>
130128
<!-- /ko -->

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ protected function getBundleSelections()
578578
'parentSelections' => 'bundle_selections',
579579
'changer' => 'option_info.type',
580580
'dataType' => Form\Element\DataType\Boolean::NAME,
581-
'label' => __('Default'),
581+
'label' => __('Is Default'),
582582
'dataScope' => 'is_default',
583583
'prefer' => 'radio',
584584
'value' => '0',

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ private function getCategoryLinkManagement()
251251

252252
/**
253253
* @return StoreManagerInterface
254+
* @deprecated
254255
*/
255256
private function getStoreManager()
256257
{
@@ -265,6 +266,7 @@ private function getStoreManager()
265266
* Retrieve data persistor
266267
*
267268
* @return DataPersistorInterface|mixed
269+
* @deprecated
268270
*/
269271
protected function getDataPersistor()
270272
{

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Backend\App\Action;
1010
use Magento\Catalog\Controller\Adminhtml\Product;
1111
use Magento\Framework\App\ObjectManager;
12+
use Magento\Store\Model\StoreManagerInterface;
1213

1314
/**
1415
* Product validate
@@ -47,6 +48,11 @@ class Validate extends \Magento\Catalog\Controller\Adminhtml\Product
4748
*/
4849
protected $initializationHelper;
4950

51+
/**
52+
* @var StoreManagerInterface
53+
*/
54+
private $storeManager;
55+
5056
/**
5157
* @param Action\Context $context
5258
* @param Builder $productBuilder
@@ -91,10 +97,12 @@ public function execute()
9197
if ($productData && !isset($productData['stock_data']['use_config_manage_stock'])) {
9298
$productData['stock_data']['use_config_manage_stock'] = 0;
9399
}
100+
$storeId = $this->getRequest()->getParam('store', 0);
101+
$store = $this->getStoreManager()->getStore($storeId);
102+
$this->getStoreManager()->setCurrentStore($store->getCode());
94103
/* @var $product \Magento\Catalog\Model\Product */
95104
$product = $this->productFactory->create();
96105
$product->setData('_edit_mode', true);
97-
$storeId = $this->getRequest()->getParam('store');
98106
if ($storeId) {
99107
$product->setStoreId($storeId);
100108
}
@@ -137,6 +145,19 @@ public function execute()
137145
return $this->resultJsonFactory->create()->setData($response);
138146
}
139147

148+
/**
149+
* @return StoreManagerInterface
150+
* @deprecated
151+
*/
152+
private function getStoreManager()
153+
{
154+
if (null === $this->storeManager) {
155+
$this->storeManager = \Magento\Framework\App\ObjectManager::getInstance()
156+
->get('Magento\Store\Model\StoreManagerInterface');
157+
}
158+
return $this->storeManager;
159+
}
160+
140161
/**
141162
* @return Initialization\Helper
142163
* @deprecated

app/code/Magento/Catalog/Model/Product/Option.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ protected function _getValidationRulesBeforeSave()
567567
public function getProductSku()
568568
{
569569
$productSku = $this->_getData(self::KEY_PRODUCT_SKU);
570-
if (!$productSku) {
570+
if (!$productSku && $this->getProduct()) {
571571
$productSku = $this->getProduct()->getSku();
572572
}
573573
return $productSku;

app/code/Magento/Catalog/Model/Product/Option/Repository.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ public function duplicate(
125125
*/
126126
public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $option)
127127
{
128-
$product = $this->productRepository->get($option->getProductSku());
128+
$productSku = $option->getProductSku();
129+
if (!$productSku) {
130+
throw new CouldNotSaveException(__('ProductSku should be specified'));
131+
}
132+
$product = $this->productRepository->get($productSku);
129133
$metadata = $this->getMetadataPool()->getMetadata(ProductInterface::class);
130134
$option->setData('product_id', $product->getData($metadata->getLinkField()));
131135
$option->setOptionId(null);

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,11 @@ public function save(\Magento\Catalog\Api\Data\ProductInterface $product, $saveO
522522
$product->setCanSaveCustomOptions(true);
523523
}
524524

525-
$useValidation = \Magento\Store\Model\Store::ADMIN_CODE === $this->storeManager->getStore()->getCode();
526-
if ($useValidation) {
527-
$validationResult = $this->resourceModel->validate($product);
528-
if (true !== $validationResult) {
529-
throw new \Magento\Framework\Exception\CouldNotSaveException(
530-
__('Invalid product data: %1', implode(',', $validationResult))
531-
);
532-
}
525+
$validationResult = $this->resourceModel->validate($product);
526+
if (true !== $validationResult) {
527+
throw new \Magento\Framework\Exception\CouldNotSaveException(
528+
__('Invalid product data: %1', implode(',', $validationResult))
529+
);
533530
}
534531

535532
try {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ public function duplicate($oldId, $newId)
523523
$this->getLinkField() . ' = ?',
524524
$oldId
525525
)->where(
526-
'store_id > ?',
526+
'store_id >= ?',
527527
0
528528
);
529529

@@ -541,7 +541,7 @@ public function duplicate($oldId, $newId)
541541
$statusAttribute = $this->getAttribute('status');
542542
$statusAttributeId = $statusAttribute->getAttributeId();
543543
$statusAttributeTable = $statusAttribute->getBackend()->getTable();
544-
$updateCond[] = 'store_id > 0';
544+
$updateCond[] = 'store_id >= 0';
545545
$updateCond[] = $connection->quoteInto($this->getLinkField() . ' = ?', $newId);
546546
$updateCond[] = $connection->quoteInto('attribute_id = ?', $statusAttributeId);
547547
$connection->update(

0 commit comments

Comments
 (0)