Skip to content

Commit 8be3622

Browse files
authored
Merge branch 'main' into phpstan-1
2 parents 55690d8 + 9ff5c56 commit 8be3622

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

.all-contributorsrc

+10
Original file line numberDiff line numberDiff line change
@@ -1679,6 +1679,16 @@
16791679
"contributions": [
16801680
"review"
16811681
]
1682+
},
1683+
{
1684+
"login": "gdemarsico",
1685+
"name": "Gastón De Mársico",
1686+
"avatar_url": "https://avatars.githubusercontent.com/u/2066819?v=4",
1687+
"profile": "https://github.com/gdemarsico",
1688+
"contributions": [
1689+
"code",
1690+
"bug"
1691+
]
16821692
}
16831693
],
16841694
"commitType": "docs"

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
271271
<td align="center" valign="top" width="14.28%"><a href="https://github.com/magentox"><img src="https://avatars.githubusercontent.com/u/44047835?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>magentox</b></sub></a></td>
272272
<td align="center" valign="top" width="14.28%"><a href="https://github.com/stasadev"><img src="https://avatars.githubusercontent.com/u/24270994?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Stanislav Zhuk</b></sub></a></td>
273273
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Axepih"><img src="https://avatars.githubusercontent.com/u/95623175?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Axepih</b></sub></a></td>
274+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/gdemarsico"><img src="https://avatars.githubusercontent.com/u/2066819?v=4" loading="lazy" width="100" alt=""/><br /><sub><b>Gastón De Mársico</b></sub></a></td>
274275
</tr>
275276
</tbody>
276277
</table>

app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC)
15201520
// optimize if using cat index
15211521
$filters = $this->_productLimitationFilters;
15221522
if (isset($filters['category_id']) || isset($filters['visibility'])) {
1523-
$this->getSelect()->order('cat_index.position ' . $dir);
1523+
$this->getSelect()->order(['cat_index.position ' . $dir, 'e.entity_id ' . $dir]);
15241524
} else {
15251525
$this->getSelect()->order('e.entity_id ' . $dir);
15261526
}

app/code/core/Mage/Eav/Model/Config.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,16 @@ protected function _loadEntityAttributes($entityType, $storeId)
224224
{
225225
// preload attributes in array form to avoid instantiating
226226
// models for every attribute even if it is never accessed
227-
$entityAttributes = $entityType->newAttributeCollection()
228-
->addStoreLabel($storeId)
229-
->getData();
227+
$collection = $entityType->newAttributeCollection()
228+
->addStoreLabel($storeId);
229+
230+
// if collection supports per-website values, set website id
231+
if ($collection instanceof Mage_Eav_Model_Resource_Attribute_Collection) {
232+
$websiteId = Mage::app()->getStore($storeId)->getWebsiteId();
233+
$collection->setWebsite($websiteId);
234+
}
235+
236+
$entityAttributes = $collection->getData();
230237

231238
$this->_entityTypeAttributes[$storeId][$entityType->getId()] = [];
232239
$attributeCodes = [];

app/code/core/Mage/Eav/Model/Entity/Type.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ public function newAttributeCollection($setId = null)
140140
*/
141141
protected function _getAttributeCollection()
142142
{
143-
$collection = Mage::getModel('eav/entity_attribute')->getCollection();
143+
$collectionClass = $this->getEntityAttributeCollection();
144+
$collection = Mage::getResourceModel($collectionClass);
144145
$objectsModel = $this->getAttributeModel();
145146
if ($objectsModel) {
146147
$collection->setModel($objectsModel);

0 commit comments

Comments
 (0)