Skip to content

Commit 8b5735f

Browse files
authored
Merge pull request #4459 from magento-tsg-csl3/2.2-develop-pr34
[TSG-CSL3] For 2.2 (pr34)
2 parents e20027b + 987ac80 commit 8b5735f

File tree

18 files changed

+505
-67
lines changed

18 files changed

+505
-67
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminDashboardPageIsVisibleActionGroup">
12+
<seeInCurrentUrl url="{{AdminDashboardPage.url}}" stepKey="seeDashboardUrl"/>
13+
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="ChangedCookieDomainForMainWebsiteConfigData">
12+
<data key="path">web/cookie/cookie_domain</data>
13+
<data key="scope">website</data>
14+
<data key="scope_code">base</data>
15+
<data key="value">testDomain.com</data>
16+
</entity>
17+
<entity name="EmptyCookieDomainForMainWebsiteConfigData">
18+
<data key="path">web/cookie/cookie_domain</data>
19+
<data key="scope">website</data>
20+
<data key="scope_code">base</data>
21+
<data key="value">''</data>
22+
</entity>
23+
</entities>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminLoginAfterChangeCookieDomainTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Login on the Admin Backend"/>
15+
<title value="Admin user can login after changing cookie domain on main website scope without changing cookie domain on default scope"/>
16+
<description value="Admin user can login after changing cookie domain on main website scope without changing cookie domain on default scope"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-17931"/>
19+
<useCaseId value="MC-17292"/>
20+
<group value="backend"/>
21+
</annotations>
22+
<before>
23+
<magentoCLI command="config:set {{ChangedCookieDomainForMainWebsiteConfigData.path}} --scope={{ChangedCookieDomainForMainWebsiteConfigData.scope}} --scope-code={{ChangedCookieDomainForMainWebsiteConfigData.scope_code}} {{ChangedCookieDomainForMainWebsiteConfigData.value}}" stepKey="changeDomainForMainWebsiteBeforeTestRun"/>
24+
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
25+
</before>
26+
<after>
27+
<magentoCLI command="config:set {{EmptyCookieDomainForMainWebsiteConfigData.path}} --scope={{EmptyCookieDomainForMainWebsiteConfigData.scope}} --scope-code={{EmptyCookieDomainForMainWebsiteConfigData.scope_code}} {{EmptyCookieDomainForMainWebsiteConfigData.value}}" stepKey="changeDomainForMainWebsiteAfterTestComplete"/>
28+
<magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestComplete"/>
29+
</after>
30+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
31+
<actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/>
32+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
33+
</test>
34+
</tests>

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<arguments>
8787
<argument name="lifetimePath" xsi:type="const">Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME</argument>
8888
<argument name="sessionName" xsi:type="const">Magento\Backend\Model\Session\AdminConfig::SESSION_NAME_ADMIN</argument>
89+
<argument name="scopeType" xsi:type="const">Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT</argument>
8990
</arguments>
9091
</type>
9192
<type name="Magento\Framework\View\Result\PageFactory">

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,6 @@ protected function customizeNewDateRangeField(array $meta)
281281
$fromContainerPath = $this->arrayManager->slicePath($fromFieldPath, 0, -2);
282282
$toContainerPath = $this->arrayManager->slicePath($toFieldPath, 0, -2);
283283
$commonFieldsMeta = [
284-
'outputDateTimeToISO' => false,
285-
'inputDateTimeFormat' => 'YYYY-MM-DD h:mm',
286284
'options' => [
287285
'showsTime' => true,
288286
]

app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\Framework\DB\Adapter\AdapterInterface;
1212
use Magento\CatalogInventory\Api\StockConfigurationInterface;
1313
use Magento\CatalogInventory\Model\Indexer\Stock\Action\Full;
14-
use Magento\Catalog\Model\Product\Attribute\Source\Status as ProductStatus;
1514

1615
/**
1716
* CatalogInventory Default Stock Status Indexer Resource Model
@@ -226,8 +225,6 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f
226225
{
227226
$connection = $this->getConnection();
228227
$qtyExpr = $connection->getCheckSql('cisi.qty > 0', 'cisi.qty', 0);
229-
$metadata = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class);
230-
$linkField = $metadata->getLinkField();
231228

232229
$select = $connection->select()->from(
233230
['e' => $this->getTable('catalog_product_entity')],
@@ -241,12 +238,6 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f
241238
['cisi' => $this->getTable('cataloginventory_stock_item')],
242239
'cisi.stock_id = cis.stock_id AND cisi.product_id = e.entity_id',
243240
[]
244-
)->joinInner(
245-
['mcpei' => $this->getTable('catalog_product_entity_int')],
246-
'e.' . $linkField . ' = mcpei.' . $linkField
247-
. ' AND mcpei.attribute_id = ' . $this->_getAttribute('status')->getId()
248-
. ' AND mcpei.value = ' . ProductStatus::STATUS_ENABLED,
249-
[]
250241
)->columns(
251242
['qty' => $qtyExpr]
252243
)->where(
@@ -317,7 +308,8 @@ protected function _updateIndex($entityIds)
317308
}
318309

319310
/**
320-
* Delete records by their ids from index table
311+
* Delete records by their ids from index table.
312+
*
321313
* Used to clean table before re-indexation
322314
*
323315
* @param array $ids
@@ -362,6 +354,8 @@ public function getIdxTable($table = null)
362354
}
363355

364356
/**
357+
* Get status expression
358+
*
365359
* @param AdapterInterface $connection
366360
* @param bool $isAggregate
367361
* @return mixed
@@ -387,6 +381,8 @@ protected function getStatusExpression(AdapterInterface $connection, $isAggregat
387381
}
388382

389383
/**
384+
* Get stock configuration
385+
*
390386
* @return StockConfigurationInterface
391387
*
392388
* @deprecated 100.1.0
@@ -402,6 +398,8 @@ protected function getStockConfiguration()
402398
}
403399

404400
/**
401+
* Get query processor composite
402+
*
405403
* @return QueryProcessorComposite
406404
*/
407405
private function getQueryProcessorComposite()

app/code/Magento/Customer/Model/Data/Address.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(
4242
}
4343

4444
/**
45-
* {@inheritdoc}
45+
* @inheritdoc
4646
*/
4747
protected function getCustomAttributesCodes()
4848
{
@@ -327,7 +327,7 @@ public function setCompany($company)
327327
*/
328328
public function setTelephone($telephone)
329329
{
330-
return $this->setData(self::TELEPHONE, $telephone);
330+
return $this->setData(self::TELEPHONE, trim($telephone));
331331
}
332332

333333
/**
@@ -452,7 +452,7 @@ public function setIsDefaultBilling($isDefaultBilling)
452452
}
453453

454454
/**
455-
* {@inheritdoc}
455+
* @inheritdoc
456456
*
457457
* @return \Magento\Customer\Api\Data\AddressExtensionInterface|null
458458
*/
@@ -462,7 +462,7 @@ public function getExtensionAttributes()
462462
}
463463

464464
/**
465-
* {@inheritdoc}
465+
* @inheritdoc
466466
*
467467
* @param \Magento\Customer\Api\Data\AddressExtensionInterface $extensionAttributes
468468
* @return $this

app/code/Magento/Eav/Model/Attribute/Data/Text.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(
4545
*/
4646
public function extractValue(RequestInterface $request)
4747
{
48-
$value = $this->_getRequestValue($request);
48+
$value = trim($this->_getRequestValue($request));
4949
return $this->_applyInputFilter($value);
5050
}
5151

@@ -82,7 +82,7 @@ public function validateValue($value)
8282
$errors = array_merge($errors, $result);
8383
}
8484

85-
$result = $this->_validateInputRule(trim($value));
85+
$result = $this->_validateInputRule($value);
8686
if ($result !== true) {
8787
$errors = array_merge($errors, $result);
8888
}

app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/TextTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ public function alphanumDataProvider(): array
139139
'QazWsx12345',
140140
[__('"%1" length must be equal or less than %2 characters.', 'Test', 10)],
141141
],
142-
[' 12345 ', true],
143142
];
144143
}
145144

app/code/Magento/Sales/Model/Order/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ public function setEmail($email)
600600
*/
601601
public function setTelephone($telephone)
602602
{
603-
return $this->setData(OrderAddressInterface::TELEPHONE, $telephone);
603+
return $this->setData(OrderAddressInterface::TELEPHONE, trim($telephone));
604604
}
605605

606606
/**

0 commit comments

Comments
 (0)