Skip to content

Commit 22a246f

Browse files
MarianaMariana
authored andcommitted
Merge branch 'MAGETWO-94077' into mpi-forwardport-0309
2 parents ed8b676 + cd6f693 commit 22a246f

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ public function addWebsiteNamesToResult()
768768
}
769769

770770
/**
771-
* {@inheritdoc}
771+
* @inheritdoc
772772
*/
773773
public function load($printQuery = false, $logQuery = false)
774774
{
@@ -819,6 +819,7 @@ protected function doAddWebsiteNamesToResult()
819819
foreach ($this as $product) {
820820
if (isset($productWebsites[$product->getId()])) {
821821
$product->setData('websites', $productWebsites[$product->getId()]);
822+
$product->setData('website_ids', $productWebsites[$product->getId()]);
822823
}
823824
}
824825
return $this;
@@ -1115,11 +1116,11 @@ public function getSelectCountSql()
11151116
/**
11161117
* Get SQL for get record count
11171118
*
1118-
* @param null $select
1119+
* @param Select $select
11191120
* @param bool $resetLeftJoins
1120-
* @return \Magento\Framework\DB\Select
1121+
* @return Select
11211122
*/
1122-
protected function _getSelectCountSql($select = null, $resetLeftJoins = true)
1123+
protected function _getSelectCountSql(?Select $select = null, $resetLeftJoins = true)
11231124
{
11241125
$this->_renderFilters();
11251126
$countSelect = $select === null ? $this->_getClearSelect() : $this->_buildClearSelect($select);
@@ -1581,7 +1582,7 @@ public function addAttributeToFilter($attribute, $condition = null, $joinType =
15811582
}
15821583

15831584
/**
1584-
* {@inheritdoc}
1585+
* @inheritdoc
15851586
* @since 101.0.0
15861587
*/
15871588
protected function getEntityPkName(\Magento\Eav\Model\Entity\AbstractEntity $entity)

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public function __construct(
290290
}
291291

292292
/**
293-
* {@inheritdoc}
293+
* @inheritdoc
294294
* @since 101.0.0
295295
*/
296296
public function modifyMeta(array $meta)
@@ -401,7 +401,7 @@ public function getContainerChildren(ProductAttributeInterface $attribute, $grou
401401
}
402402

403403
/**
404-
* {@inheritdoc}
404+
* @inheritdoc
405405
* @since 101.0.0
406406
*/
407407
public function modifyData(array $data)
@@ -944,6 +944,9 @@ private function canDisplayUseDefault(ProductAttributeInterface $attribute)
944944
$attributeCode = $attribute->getAttributeCode();
945945
/** @var Product $product */
946946
$product = $this->locator->getProduct();
947+
if ($product->isLockedAttribute($attributeCode)) {
948+
return false;
949+
}
947950

948951
if (isset($this->canDisplayUseDefault[$attributeCode])) {
949952
return $this->canDisplayUseDefault[$attributeCode];

dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_two_websites_rollback.php

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

7-
use Magento\Catalog\Api\Data\ProductInterface;
8-
97
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
108

119
/** @var \Magento\Framework\Registry $registry */
@@ -15,16 +13,18 @@
1513
$registry->register("isSecureArea", true);
1614

1715
/** @var Magento\Store\Model\Website $website */
18-
$website = $objectManager->create(\Magento\Store\Model\Website::class);
19-
$website->load('second_website');
20-
$website->delete();
16+
$website = $objectManager->get(Magento\Store\Model\Website::class);
17+
$website->load('second_website', 'code');
18+
if ($website->getId()) {
19+
$website->delete();
20+
}
2121

2222
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
2323
$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
2424

2525
try {
2626
$firstProduct = $productRepository->get('unique-simple-azaza');
27-
$firstProduct->delete();
27+
$productRepository->delete($firstProduct);
2828
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
2929
//Product already removed
3030
}

0 commit comments

Comments
 (0)