Skip to content

Commit 086cd2a

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into FearlessKiwis-MAGETWO-66402-mov-get-allids
2 parents c193393 + 35e2dbb commit 086cd2a

File tree

11 files changed

+59
-16
lines changed

11 files changed

+59
-16
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,9 @@ public function save(\Magento\Catalog\Api\Data\ProductInterface $product, $saveO
564564
$this->resourceModel->getLinkField(),
565565
$existingProduct->getData($this->resourceModel->getLinkField())
566566
);
567+
if (!$product->hasData(Product::STATUS)) {
568+
$product->setStatus($existingProduct->getStatus());
569+
}
567570
} catch (NoSuchEntityException $e) {
568571
$existingProduct = null;
569572
}

app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
<item name="add_variables" xsi:type="boolean">false</item>
194194
<item name="add_widgets" xsi:type="boolean">false</item>
195195
<item name="add_images" xsi:type="boolean">false</item>
196+
<item name="add_directives" xsi:type="boolean">true</item>
196197
</item>
197198
<item name="source" xsi:type="string">category</item>
198199
</item>

app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Magento\Cron\Observer;
1111

1212
use Magento\Framework\App\State;
13-
use Magento\Framework\Console\CLI;
13+
use Magento\Framework\Console\Cli;
1414
use Magento\Framework\Event\ObserverInterface;
1515
use \Magento\Cron\Model\Schedule;
1616

@@ -188,7 +188,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
188188
) == 1
189189
)) {
190190
$this->_shell->execute(
191-
$phpPath . ' %s cron:run --group=' . $groupId . ' --' . CLI::INPUT_KEY_BOOTSTRAP . '='
191+
$phpPath . ' %s cron:run --group=' . $groupId . ' --' . Cli::INPUT_KEY_BOOTSTRAP . '='
192192
. self::STANDALONE_PROCESS_STARTED . '=1',
193193
[
194194
BP . '/bin/magento'

app/code/Magento/Theme/view/frontend/templates/html/breadcrumbs.phtml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
<?php foreach ($crumbs as $crumbName => $crumbInfo) : ?>
1414
<li class="item <?php /* @escapeNotVerified */ echo $crumbName ?>">
1515
<?php if ($crumbInfo['link']) : ?>
16-
<a href="<?php /* @escapeNotVerified */ echo $crumbInfo['link'] ?>" title="<?php echo $block->escapeHtml($crumbInfo['title']) ?>">
17-
<?php echo $block->escapeHtml($crumbInfo['label']) ?>
18-
</a>
16+
<a href="<?php /* @escapeNotVerified */ echo $crumbInfo['link'] ?>" title="<?php echo $block->escapeHtml($crumbInfo['title']) ?>"><?php echo $block->escapeHtml($crumbInfo['label']) ?></a>
1917
<?php elseif ($crumbInfo['last']) : ?>
2018
<strong><?php echo $block->escapeHtml($crumbInfo['label']) ?></strong>
2119
<?php else: ?>

dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,4 +1266,34 @@ public function testSpecialPrice()
12661266
$this->assertEquals(0, count(array_intersect($attributeCodes, $missingAttributes)));
12671267
$this->assertEquals(2, count(array_intersect($attributeCodes, $expectedAttribute)));
12681268
}
1269+
1270+
public function testUpdateStatus()
1271+
{
1272+
// Create simple product
1273+
$productData = [
1274+
ProductInterface::SKU => "product_simple_502",
1275+
ProductInterface::NAME => "Product Simple 502",
1276+
ProductInterface::VISIBILITY => 4,
1277+
ProductInterface::TYPE_ID => 'simple',
1278+
ProductInterface::PRICE => 100,
1279+
ProductInterface::STATUS => 0,
1280+
ProductInterface::TYPE_ID => 'simple',
1281+
ProductInterface::ATTRIBUTE_SET_ID => 4,
1282+
];
1283+
1284+
// Save product with status disabled
1285+
$this->saveProduct($productData);
1286+
$response = $this->getProduct($productData[ProductInterface::SKU]);
1287+
$this->assertEquals(0, $response['status']);
1288+
1289+
// Update the product
1290+
$productData[ProductInterface::PRICE] = 200;
1291+
$this->saveProduct($productData);
1292+
$response = $this->getProduct($productData[ProductInterface::SKU]);
1293+
1294+
// Status should still be disabled
1295+
$this->assertEquals(0, $response['status']);
1296+
// Price should be updated
1297+
$this->assertEquals(200, $response['price']);
1298+
}
12691299
}

dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\CatalogSearch\Test\TestCase\SuggestSearchingResultEntityTest" summary="Suggest Searching Results" ticketId="MAGETWO-24671, MAGETWO-23186">
1010
<variation name="SuggestSearchingResultEntityTestVariation1" summary="Auto-complete search with product name" ticketId="MAGETWO-24671">
11-
<data name="tag" xsi:type="string">stable:no</data>
1211
<data name="searchTerm/data/query_text/value" xsi:type="string">catalogProductSimple::name</data>
1312
<data name="searchTerm/data/num_results" xsi:type="string">-</data>
1413
<constraint name="Magento\CatalogSearch\Test\Constraint\AssertSuggestSearchingResult" />
1514
</variation>
1615
<variation name="SuggestSearchingResultEntityTestVariation2" summary="Auto-complete search with product sku" ticketId="MAGETWO-24671">
17-
<data name="tag" xsi:type="string">stable:no</data>
1816
<data name="searchTerm/data/query_text/value" xsi:type="string">catalogProductSimple::sku</data>
1917
<data name="searchTerm/data/num_results" xsi:type="string">1</data>
2018
<constraint name="Magento\CatalogSearch\Test\Constraint\AssertSuggestSearchingResult" />

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CustomerForm extends FormTabs
2222
*
2323
* @var string
2424
*/
25-
protected $spinner = '[data-role="spinner"]';
25+
protected $spinner = '#container [data-role="spinner"]';
2626

2727
/**
2828
* Customer form to load.
@@ -46,7 +46,7 @@ class CustomerForm extends FormTabs
4646
protected $fieldWrapperControl = './/*[contains(@class, "admin__field")]/*[contains(@class,"control")]';
4747

4848
/**
49-
* Selector for wainting tab content to load.
49+
* Selector for waiting tab content to load.
5050
*
5151
* @var string
5252
*/
@@ -179,6 +179,8 @@ public function getJsErrors()
179179
*/
180180
public function getPersonalInformation($title)
181181
{
182-
return $this->_rootElement->find(sprintf($this->information, $title), Locator::SELECTOR_XPATH)->getText();
182+
return $this->_rootElement
183+
->find(sprintf($this->information, $title), Locator::SELECTOR_XPATH)
184+
->getText();
183185
}
184186
}

dev/tests/functional/tests/app/Magento/Store/Test/Handler/StoreGroup/Curl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function prepareData(FixtureInterface $fixture)
8484
'root_category_id' => $categoryId,
8585
'website_id' => $websiteId,
8686
'group_id' => $fixture->hasData('group_id') ? $fixture->getGroupId() : '',
87-
'code' => $fixture->getData()['code'],
87+
'code' => $fixture->hasData('code') ? $fixture->getData()['code'] : '',
8888
],
8989
'store_action' => 'add',
9090
'store_type' => 'group',

lib/internal/Magento/Framework/Exception/LocalizedException.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@ class LocalizedException extends \Exception
2626
protected $logMessage;
2727

2828
/**
29-
* Constructor
30-
*
3129
* @param \Magento\Framework\Phrase $phrase
3230
* @param \Exception $cause
31+
* @param int $code
3332
*/
34-
public function __construct(Phrase $phrase, \Exception $cause = null)
33+
public function __construct(Phrase $phrase, \Exception $cause = null, $code = 0)
3534
{
3635
$this->phrase = $phrase;
37-
parent::__construct($phrase->render(), 0, $cause);
36+
parent::__construct($phrase->render(), intval($code), $cause);
3837
}
3938

4039
/**

lib/internal/Magento/Framework/Exception/Test/Unit/LocalizedExceptionTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,16 @@ public function testGetLogMessage()
150150
$expectedLogMessage = 'message parameter1 parameter2';
151151
$this->assertEquals($expectedLogMessage, $localizeException->getLogMessage());
152152
}
153+
154+
public function testGetCode()
155+
{
156+
$expectedCode = 42;
157+
$localizedException = new LocalizedException(
158+
new Phrase("message %1", ['test']),
159+
new \Exception(),
160+
$expectedCode
161+
);
162+
163+
$this->assertEquals($expectedCode, $localizedException->getCode());
164+
}
153165
}

0 commit comments

Comments
 (0)