File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed
app/code/Magento/Customer/Model
dev/tests/integration/testsuite/Magento/Customer/Controller Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,11 @@ public function initByRequest($observer)
169
169
170
170
$ this ->setLastVisitAt ((new \DateTime ())->format (\Magento \Framework \Stdlib \DateTime::DATETIME_PHP_FORMAT ));
171
171
172
+ // prevent saving Visitor for safe methods, e.g. GET request
173
+ if ($ this ->requestSafety ->isSafeMethod ()) {
174
+ return $ this ;
175
+ }
176
+
172
177
if (!$ this ->getId ()) {
173
178
$ this ->setSessionId ($ this ->session ->getSessionId ());
174
179
$ this ->save ();
Original file line number Diff line number Diff line change @@ -798,21 +798,6 @@ public function loginPostRedirectDataProvider()
798
798
];
799
799
}
800
800
801
- /**
802
- * @magentoDataFixture Magento/Customer/_files/customer.php
803
- * @magentoDataFixture Magento/Customer/_files/customer_address.php
804
- * @magentoAppArea frontend
805
- */
806
- public function testCheckVisitorModel ()
807
- {
808
- /** @var \Magento\Customer\Model\Visitor $visitor */
809
- $ visitor = $ this ->_objectManager ->get (\Magento \Customer \Model \Visitor::class);
810
- $ this ->login (1 );
811
- $ this ->assertNull ($ visitor ->getId ());
812
- $ this ->dispatch ('customer/account/index ' );
813
- $ this ->assertNotNull ($ visitor ->getId ());
814
- }
815
-
816
801
/**
817
802
* @param string $email
818
803
* @return void
You can’t perform that action at this time.
0 commit comments