File tree Expand file tree Collapse file tree 5 files changed +61
-4
lines changed
Model/ResourceModel/Catalog Expand file tree Collapse file tree 5 files changed +61
-4
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Baldwin \UrlDataIntegrityChecker \MagentoCoreBugFixes ;
6+
7+ /**
8+ * Silly workaround for core Magento bug introduced in 2.4.2
9+ * - https://github.com/magento/magento2/issues/32292
10+ * - https://github.com/baldwin-agency/magento2-module-url-data-integrity-checker/issues/16
11+ */
12+ class FakeSelectForMagentoIssue32292
13+ {
14+ /**
15+ * @return array<mixed>
16+ */
17+ public function getPart (string $ part ): array
18+ {
19+ return [];
20+ }
21+ }
Original file line number Diff line number Diff line change 55namespace Baldwin \UrlDataIntegrityChecker \Model \ResourceModel \Catalog \Category ;
66
77use Baldwin \UrlDataIntegrityChecker \Checker \Catalog \Category \UrlKey as UrlKeyChecker ;
8+ use Baldwin \UrlDataIntegrityChecker \MagentoCoreBugFixes \FakeSelectForMagentoIssue32292 as FakeSelect ;
89use Baldwin \UrlDataIntegrityChecker \Storage \StorageInterface ;
910use Magento \Framework \Api \AttributeInterface ;
1011use Magento \Framework \Api \AttributeValue ;
1819class UrlKeyCollection extends DataCollection implements SearchResultInterface
1920{
2021 private $ storage ;
22+ private $ fakeSelect ;
2123
2224 public function __construct (
2325 EntityFactoryInterface $ entityFactory ,
24- StorageInterface $ storage
26+ StorageInterface $ storage ,
27+ FakeSelect $ fakeSelect
2528 ) {
2629 parent ::__construct ($ entityFactory );
2730
2831 $ this ->storage = $ storage ;
32+ $ this ->fakeSelect = $ fakeSelect ;
2933 }
3034
3135 /**
@@ -141,4 +145,9 @@ public function setTotalCount($totalCount)
141145 {
142146 throw new LocalizedException (__ ('Not implemented: setTotalCount! ' ));
143147 }
148+
149+ public function getSelect (): FakeSelect
150+ {
151+ return $ this ->fakeSelect ;
152+ }
144153}
Original file line number Diff line number Diff line change 55namespace Baldwin \UrlDataIntegrityChecker \Model \ResourceModel \Catalog \Category ;
66
77use Baldwin \UrlDataIntegrityChecker \Checker \Catalog \Category \UrlPath as UrlPathChecker ;
8+ use Baldwin \UrlDataIntegrityChecker \MagentoCoreBugFixes \FakeSelectForMagentoIssue32292 as FakeSelect ;
89use Baldwin \UrlDataIntegrityChecker \Storage \StorageInterface ;
910use Magento \Framework \Api \AttributeInterface ;
1011use Magento \Framework \Api \AttributeValue ;
1819class UrlPathCollection extends DataCollection implements SearchResultInterface
1920{
2021 private $ storage ;
22+ private $ fakeSelect ;
2123
2224 public function __construct (
2325 EntityFactoryInterface $ entityFactory ,
24- StorageInterface $ storage
26+ StorageInterface $ storage ,
27+ FakeSelect $ fakeSelect
2528 ) {
2629 parent ::__construct ($ entityFactory );
2730
2831 $ this ->storage = $ storage ;
32+ $ this ->fakeSelect = $ fakeSelect ;
2933 }
3034
3135 /**
@@ -141,4 +145,9 @@ public function setTotalCount($totalCount)
141145 {
142146 throw new LocalizedException (__ ('Not implemented: setTotalCount! ' ));
143147 }
148+
149+ public function getSelect (): FakeSelect
150+ {
151+ return $ this ->fakeSelect ;
152+ }
144153}
Original file line number Diff line number Diff line change 55namespace Baldwin \UrlDataIntegrityChecker \Model \ResourceModel \Catalog \Product ;
66
77use Baldwin \UrlDataIntegrityChecker \Checker \Catalog \Product \UrlKey as UrlKeyChecker ;
8+ use Baldwin \UrlDataIntegrityChecker \MagentoCoreBugFixes \FakeSelectForMagentoIssue32292 as FakeSelect ;
89use Baldwin \UrlDataIntegrityChecker \Storage \StorageInterface ;
910use Magento \Framework \Api \AttributeInterface ;
1011use Magento \Framework \Api \AttributeValue ;
1819class UrlKeyCollection extends DataCollection implements SearchResultInterface
1920{
2021 private $ storage ;
22+ private $ fakeSelect ;
2123
2224 public function __construct (
2325 EntityFactoryInterface $ entityFactory ,
24- StorageInterface $ storage
26+ StorageInterface $ storage ,
27+ FakeSelect $ fakeSelect
2528 ) {
2629 parent ::__construct ($ entityFactory );
2730
2831 $ this ->storage = $ storage ;
32+ $ this ->fakeSelect = $ fakeSelect ;
2933 }
3034
3135 /**
@@ -141,4 +145,9 @@ public function setTotalCount($totalCount)
141145 {
142146 throw new LocalizedException (__ ('Not implemented: setTotalCount! ' ));
143147 }
148+
149+ public function getSelect (): FakeSelect
150+ {
151+ return $ this ->fakeSelect ;
152+ }
144153}
Original file line number Diff line number Diff line change 55namespace Baldwin \UrlDataIntegrityChecker \Model \ResourceModel \Catalog \Product ;
66
77use Baldwin \UrlDataIntegrityChecker \Checker \Catalog \Product \UrlPath as UrlPathChecker ;
8+ use Baldwin \UrlDataIntegrityChecker \MagentoCoreBugFixes \FakeSelectForMagentoIssue32292 as FakeSelect ;
89use Baldwin \UrlDataIntegrityChecker \Storage \StorageInterface ;
910use Magento \Framework \Api \AttributeInterface ;
1011use Magento \Framework \Api \AttributeValue ;
1819class UrlPathCollection extends DataCollection implements SearchResultInterface
1920{
2021 private $ storage ;
22+ private $ fakeSelect ;
2123
2224 public function __construct (
2325 EntityFactoryInterface $ entityFactory ,
24- StorageInterface $ storage
26+ StorageInterface $ storage ,
27+ FakeSelect $ fakeSelect
2528 ) {
2629 parent ::__construct ($ entityFactory );
2730
2831 $ this ->storage = $ storage ;
32+ $ this ->fakeSelect = $ fakeSelect ;
2933 }
3034
3135 /**
@@ -141,4 +145,9 @@ public function setTotalCount($totalCount)
141145 {
142146 throw new LocalizedException (__ ('Not implemented: setTotalCount! ' ));
143147 }
148+
149+ public function getSelect (): FakeSelect
150+ {
151+ return $ this ->fakeSelect ;
152+ }
144153}
You can’t perform that action at this time.
0 commit comments