We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a6ad60 commit 4c07379Copy full SHA for 4c07379
app/code/Magento/Elasticsearch/Model/Indexer/IndexerHandler.php
@@ -145,9 +145,13 @@ private function updateCacheContext(array $docs) : void
145
{
146
$categoryIds = [];
147
foreach ($docs as $document) {
148
- if (!empty($document['category_ids']) && is_array($document['category_ids'])) {
149
- foreach ($document['category_ids'] as $id) {
150
- $categoryIds[] = $id;
+ if (!empty($document['category_ids'])) {
+ if (is_array($document['category_ids'])) {
+ foreach ($document['category_ids'] as $id) {
151
+ $categoryIds[] = $id;
152
+ }
153
+ } else {
154
+ $categoryIds[] = $document['category_ids'];
155
}
156
157
0 commit comments