Skip to content

Commit

Permalink
Merge pull request magento#3895 from magento-arcticfoxes/pr
Browse files Browse the repository at this point in the history
[2.3.1-release] Bug Fixes
  • Loading branch information
joanhe authored Mar 14, 2019
2 parents bb7d459 + 6384b15 commit 2b0280a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
5 changes: 1 addition & 4 deletions app/code/Magento/Customer/Model/Visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*
* @package Magento\Customer\Model
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class Visitor extends \Magento\Framework\Model\AbstractModel
{
Expand Down Expand Up @@ -168,10 +169,6 @@ public function initByRequest($observer)

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

// prevent saving Visitor for safe methods, e.g. GET request
if ($this->requestSafety->isSafeMethod()) {
return $this;
}
if (!$this->getId()) {
$this->setSessionId($this->session->getSessionId());
$this->save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* @magentoDbIsolation disabled
* @magentoIndexerDimensionMode catalog_product_price website_and_customer_group
* @group indexer_dimension
* @magentoAppArea frontend
*/
class FixedBundlePriceCalculatorWithDimensionTest extends BundlePriceAbstract
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,21 @@ public function loginPostRedirectDataProvider()
];
}

/**
* @magentoDataFixture Magento/Customer/_files/customer.php
* @magentoDataFixture Magento/Customer/_files/customer_address.php
* @magentoAppArea frontend
*/
public function testCheckVisitorModel()
{
/** @var \Magento\Customer\Model\Visitor $visitor */
$visitor = $this->_objectManager->get(\Magento\Customer\Model\Visitor::class);
$this->login(1);
$this->assertNull($visitor->getId());
$this->dispatch('customer/account/index');
$this->assertNotNull($visitor->getId());
}

/**
* @param string $email
* @return void
Expand Down

0 comments on commit 2b0280a

Please sign in to comment.