Skip to content

Commit 23be3be

Browse files
ACPT-1194-part2
Don't call reset() method from _resetState() method in Collections!
1 parent f510925 commit 23be3be

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ public function _resetState(): void
399399
{
400400
parent::_resetState();
401401
$this->_flatEnabled = [];
402-
$this->_initTables();
403402
$this->_addUrlRewrite = false;
404403
$this->_urlRewriteCategory = '';
405404
$this->_addFinalPrice = false;
@@ -420,6 +419,7 @@ public function _resetState(): void
420419
$this->linkField = null;
421420
$this->backend = null;
422421
$this->emptyItem = null;
422+
$this->_construct();
423423
}
424424

425425
/**

app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,12 @@ public function _resetState(): void
189189
$this->_itemsById = [];
190190
$this->_staticFields = [];
191191
$this->_entity = null;
192-
$this->_reset();
192+
$this->_selectEntityTypes = [];
193+
$this->_selectAttributes = [];
194+
$this->_filterAttributes = [];
195+
$this->_joinEntities = [];
196+
$this->_joinAttributes = [];
197+
$this->_joinFields = [];
193198
}
194199

195200
/**

lib/internal/Magento/Framework/Data/Collection/AbstractDb.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,14 @@ public function __construct(
125125
public function _resetState(): void
126126
{
127127
parent::_resetState();
128-
$this->_reset();
128+
$this->setConnection($this->_conn);
129129
$this->_idFieldName = null;
130130
$this->_bindParams = [];
131+
$this->_data = null;
131132
$this->map = null;
132133
$this->_fetchStmt = null;
133134
$this->_isOrdersRendered = false;
135+
$this->extensionAttributesJoinProcessor = null;
134136
}
135137

136138
/**

0 commit comments

Comments
 (0)