Skip to content

Commit 6141adc

Browse files
Merge pull request #88 from magmodules/release/2.5.1
Release/2.5.1
2 parents a646554 + f291936 commit 6141adc

File tree

5 files changed

+34
-17
lines changed

5 files changed

+34
-17
lines changed

.github/workflows/compile-and-phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77
matrix:
88
include:
99
- PHP_VERSION: php74-fpm
10-
MAGENTO_VERSION: 2.4.0
10+
MAGENTO_VERSION: 2.4.4-p13
1111
- PHP_VERSION: php81-fpm
1212
MAGENTO_VERSION: 2.4.6-p4
1313
- PHP_VERSION: php83-fpm
1414
MAGENTO_VERSION: 2.4.7
1515
- PHP_VERSION: php84-fpm
16-
MAGENTO_VERSION: 2.4.8
16+
MAGENTO_VERSION: 2.4.8-p2
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v1

Service/ProductData/AttributeCollector/Data/Parents.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,18 @@ private function fetchStatusAttributeId(): ?int
140140
{
141141
$connection = $this->resource->getConnection();
142142
$eavTable = $this->resource->getTableName('eav_attribute');
143+
$entityTypeTable = $this->resource->getTableName('eav_entity_type');
143144

144145
return (int) $connection->fetchOne(
145146
$connection->select()
146-
->from($eavTable, ['attribute_id'])
147-
->where('entity_type_id = ?', 4)
148-
->where('attribute_code = ?', 'status')
147+
->from(['ea' => $eavTable], ['attribute_id'])
148+
->join(
149+
['et' => $entityTypeTable],
150+
'ea.entity_type_id = et.entity_type_id',
151+
[]
152+
)
153+
->where('et.entity_type_code = ?', 'catalog_product')
154+
->where('ea.attribute_code = ?', 'status')
149155
->limit(1)
150156
) ?: null;
151157
}

Service/ProductData/Filter.php

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,17 @@ public function execute(array $filter, int $storeId = 0): array
4848
$entityIds = $this->filterVisibility($filter, $storeId);
4949
$entityIds = $this->filterStatus($entityIds, $filter['add_disabled_products'], $storeId);
5050

51-
$websiteId = $storeId ? $this->getWebsiteId($storeId) : null;
52-
return $this->filterByWebsiteAndCategory(
53-
$entityIds,
54-
$websiteId,
55-
$filter['category_restriction_behaviour'],
56-
$filter['category']
57-
);
51+
if ($filter['restrict_by_category']) {
52+
$websiteId = $storeId ? $this->getWebsiteId($storeId) : null;
53+
$entityIds = $this->filterByWebsiteAndCategory(
54+
$entityIds,
55+
$websiteId,
56+
$filter['category_restriction_behaviour'],
57+
$filter['category']
58+
);
59+
}
60+
61+
return $entityIds;
5862
}
5963

6064
/**
@@ -63,13 +67,20 @@ public function execute(array $filter, int $storeId = 0): array
6367
private function prefetchAttributeIds(): void
6468
{
6569
$connection = $this->resourceConnection->getConnection();
70+
71+
$entityTypeTable = $this->resourceConnection->getTableName('eav_entity_type');
6672
$eavTable = $this->resourceConnection->getTableName('eav_attribute');
6773

6874
$attributes = $connection->fetchPairs(
6975
$connection->select()
70-
->from($eavTable, ['attribute_code', 'attribute_id'])
71-
->where('entity_type_id = ?', 4)
72-
->where('attribute_code IN (?)', ['status', 'visibility'])
76+
->from(['ea' => $eavTable], ['attribute_code', 'attribute_id'])
77+
->join(
78+
['et' => $entityTypeTable],
79+
'ea.entity_type_id = et.entity_type_id',
80+
[]
81+
)
82+
->where('et.entity_type_code = ?', 'catalog_product')
83+
->where('ea.attribute_code IN (?)', ['status', 'visibility'])
7384
);
7485

7586
$this->statusAttributeId = (int)($attributes['status'] ?? 0);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magmodules/magento2-sooqr",
33
"description": "Sooqr integration for Magento 2",
44
"type": "magento2-module",
5-
"version": "2.5.0",
5+
"version": "2.5.1",
66
"license": [
77
"OSL-3.0",
88
"AFL-3.0"

etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<sooqr_general>
1212
<general>
1313
<enable>1</enable>
14-
<version>v2.5.0</version>
14+
<version>v2.5.1</version>
1515
</general>
1616
<credentials>
1717
<environment>production</environment>

0 commit comments

Comments
 (0)