Skip to content

Commit 2b0280a

Browse files
authored
Merge pull request #3895 from magento-arcticfoxes/pr
[2.3.1-release] Bug Fixes
2 parents bb7d459 + 6384b15 commit 2b0280a

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

app/code/Magento/Customer/Model/Visitor.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*
1515
* @package Magento\Customer\Model
1616
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
17+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1718
*/
1819
class Visitor extends \Magento\Framework\Model\AbstractModel
1920
{
@@ -168,10 +169,6 @@ public function initByRequest($observer)
168169

169170
$this->setLastVisitAt((new \DateTime())->format(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT));
170171

171-
// prevent saving Visitor for safe methods, e.g. GET request
172-
if ($this->requestSafety->isSafeMethod()) {
173-
return $this;
174-
}
175172
if (!$this->getId()) {
176173
$this->setSessionId($this->session->getSessionId());
177174
$this->save();

dev/tests/integration/testsuite/Magento/Bundle/Model/Product/FixedBundlePriceCalculatorWithDimensionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* @magentoDbIsolation disabled
1414
* @magentoIndexerDimensionMode catalog_product_price website_and_customer_group
1515
* @group indexer_dimension
16-
* @magentoAppArea frontend
1716
*/
1817
class FixedBundlePriceCalculatorWithDimensionTest extends BundlePriceAbstract
1918
{

dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,21 @@ public function loginPostRedirectDataProvider()
751751
];
752752
}
753753

754+
/**
755+
* @magentoDataFixture Magento/Customer/_files/customer.php
756+
* @magentoDataFixture Magento/Customer/_files/customer_address.php
757+
* @magentoAppArea frontend
758+
*/
759+
public function testCheckVisitorModel()
760+
{
761+
/** @var \Magento\Customer\Model\Visitor $visitor */
762+
$visitor = $this->_objectManager->get(\Magento\Customer\Model\Visitor::class);
763+
$this->login(1);
764+
$this->assertNull($visitor->getId());
765+
$this->dispatch('customer/account/index');
766+
$this->assertNotNull($visitor->getId());
767+
}
768+
754769
/**
755770
* @param string $email
756771
* @return void

0 commit comments

Comments
 (0)