File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
CatalogRule/Model/Indexer
Rule/Model/ResourceModel/Rule/Collection Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,9 @@ public function reindexByIds(array $ids)
159
159
$ this ->doReindexByIds ($ ids );
160
160
} catch (\Exception $ e ) {
161
161
$ this ->critical ($ e );
162
- throw new \Magento \Framework \Exception \LocalizedException (__ ($ e ->getMessage ()), $ e );
162
+ throw new \Magento \Framework \Exception \LocalizedException (
163
+ __ ("Catalog rule indexing failed. See details in exception log. " )
164
+ );
163
165
}
164
166
}
165
167
@@ -193,7 +195,9 @@ public function reindexFull()
193
195
$ this ->doReindexFull ();
194
196
} catch (\Exception $ e ) {
195
197
$ this ->critical ($ e );
196
- throw new \Magento \Framework \Exception \LocalizedException (__ ($ e ->getMessage ()), $ e );
198
+ throw new \Magento \Framework \Exception \LocalizedException (
199
+ __ ("Catalog rule indexing failed. See details in exception log. " )
200
+ );
197
201
}
198
202
}
199
203
Original file line number Diff line number Diff line change @@ -74,15 +74,18 @@ public function addWebsitesToResult($flag = null)
74
74
*/
75
75
public function addWebsiteFilter ($ websiteId )
76
76
{
77
- $ entityInfo = $ this ->_getAssociatedEntityInfo ('website ' );
78
77
if (!$ this ->getFlag ('is_website_table_joined ' )) {
78
+ $ websiteIds = is_array ($ websiteId ) ? $ websiteId : [$ websiteId ];
79
+ $ entityInfo = $ this ->_getAssociatedEntityInfo ('website ' );
79
80
$ this ->setFlag ('is_website_table_joined ' , true );
80
- if ($ websiteId instanceof \Magento \Store \Model \Website) {
81
- $ websiteId = $ websiteId ->getId ();
81
+ foreach ($ websiteIds as $ index => $ website ) {
82
+ if ($ website instanceof \Magento \Store \Model \Website) {
83
+ $ websiteIds [$ index ] = $ website ->getId ();
84
+ }
82
85
}
83
86
$ this ->getSelect ()->join (
84
87
['website ' => $ this ->getTable ($ entityInfo ['associations_table ' ])],
85
- $ this ->getConnection ()->quoteInto ('website. ' . $ entityInfo ['entity_id_field ' ] . ' = ? ' , $ websiteId )
88
+ $ this ->getConnection ()->quoteInto ('website. ' . $ entityInfo ['entity_id_field ' ] . ' IN (?) ' , $ websiteIds )
86
89
. ' AND main_table. ' . $ entityInfo ['rule_id_field ' ] . ' = website. ' . $ entityInfo ['rule_id_field ' ],
87
90
[]
88
91
);
You can’t perform that action at this time.
0 commit comments