Skip to content

Commit 03e14f0

Browse files
committed
PB-418: [AR] Data collection failed due to an error in ContentTypeUsageReportProvider
1 parent cd3c5b3 commit 03e14f0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

app/code/Magento/PageBuilderAnalytics/Model/ContentTypeUsageReportProvider.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@ public function getReport($name) : \IteratorIterator
101101
foreach ($batchQuery->fetchAll() as $row) {
102102
foreach ($contentTypes as $type) {
103103
// Count the amount of content types within the content
104-
$typeCounts[$type['name']] += substr_count(
105-
$row['content'] ?? '',
106-
'data-content-type="' . $type['name'] . '"'
107-
);
104+
$rowContent = $row['content'] ?? '';
105+
if (strlen($rowContent) > 0) {
106+
$typeCounts[$type['name']] += substr_count(
107+
$rowContent,
108+
'data-content-type="' . $type['name'] . '"'
109+
);
110+
}
108111
}
109112
}
110113
}

0 commit comments

Comments
 (0)