From 645c0252ea6fc3983c450cd8b37594f5957d2c6f Mon Sep 17 00:00:00 2001 From: Henk Valk Date: Fri, 12 May 2023 15:13:27 +0200 Subject: [PATCH] Update ReportActions.php Fixed following error: Experius\Csp\Model\ReportRepository::extractHostSource(): Argument #1 ($url) must be of type string, null given, called in /data/web/magento2/vendor/experius/module-csp/Ui/Component/Listing/Column/ReportActions.php on line 74 --- Ui/Component/Listing/Column/ReportActions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Ui/Component/Listing/Column/ReportActions.php b/Ui/Component/Listing/Column/ReportActions.php index 0c8b5cb..2337fe1 100644 --- a/Ui/Component/Listing/Column/ReportActions.php +++ b/Ui/Component/Listing/Column/ReportActions.php @@ -71,7 +71,11 @@ public function prepareDataSource(array $dataSource) if (isset($dataSource['data']['items'])) { foreach ($dataSource['data']['items'] as & $item) { if (isset($item['report_id'])) { - $hostSource = $this->reportRepository->extractHostSource($item['blocked_uri']); + if ($item['blocked_uri']) { + $hostSource = $this->reportRepository->extractHostSource($item['blocked_uri']); + } else { + $hostSource = 'no uri'; + } $item[$this->getData('name')] = [ 'view' => [ 'href' => $this->urlBuilder->getUrl(