From 10b0847a6bbead88ef2e7182e3e5ad21d0ca27b4 Mon Sep 17 00:00:00 2001 From: Michael Telgmann Date: Thu, 7 Dec 2023 15:12:44 +0100 Subject: [PATCH] fix: Improve PHP 8.2 compatibility --- Components/DbAdapters/ProductsDbAdapter.php | 4 ++-- Components/DbAdapters/ProductsPricesDbAdapter.php | 4 ++-- plugin.xml | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Components/DbAdapters/ProductsDbAdapter.php b/Components/DbAdapters/ProductsDbAdapter.php index 038342c9..bd70e8c1 100644 --- a/Components/DbAdapters/ProductsDbAdapter.php +++ b/Components/DbAdapters/ProductsDbAdapter.php @@ -263,8 +263,8 @@ public function read(array $ids, array $columns): array $record['regulationPrice'] = \round($record['regulationPrice'] * (100 + $record['tax']) / 100, 2); } } else { - $record['price'] = \round($record['price'], 2); - $record['pseudoPrice'] = \round($record['pseudoPrice'], 2); + $record['price'] = \round($record['price'] ?? 0, 2); + $record['pseudoPrice'] = \round($record['pseudoPrice'] ?? 0, 2); if (SwagVersionHelper::isShopware578() && isset($record['regulationPrice'])) { $record['regulationPrice'] = round($record['regulationPrice'], 2); } diff --git a/Components/DbAdapters/ProductsPricesDbAdapter.php b/Components/DbAdapters/ProductsPricesDbAdapter.php index 49242b57..e6f5bd48 100644 --- a/Components/DbAdapters/ProductsPricesDbAdapter.php +++ b/Components/DbAdapters/ProductsPricesDbAdapter.php @@ -206,8 +206,8 @@ public function read(array $ids, array $columns): array $record['regulationPrice'] = \round($record['regulationPrice'] * (100 + $record['tax']) / 100, 2); } } else { - $record['price'] = \round($record['price'], 2); - $record['pseudoPrice'] = \round($record['pseudoPrice'], 2); + $record['price'] = \round($record['price'] ?? 0, 2); + $record['pseudoPrice'] = \round($record['pseudoPrice'] ?? 0, 2); if (SwagVersionHelper::isShopware578() && isset($record['regulationPrice'])) { $record['regulationPrice'] = \round($record['regulationPrice'], 2); } diff --git a/plugin.xml b/plugin.xml index 19ff7afb..873c0ea5 100644 --- a/plugin.xml +++ b/plugin.xml @@ -15,6 +15,11 @@ Das Importieren und Exportieren von Artikeln, Kunden oder Kategorien gehört zum Alltag vieler Shopbetreiber: Schnell lassen sich so Lagerbestände aktualisieren, Preise anpassen oder Erstimporte vornehmen. Importing and exporting product and customer data, categories as well as product images is a standard task of any shop owner. Keeping that in mind, Shopware wants to make it as easy as possible for you to quickly edit inventory, prices or even perform a customized import. + + PHP 8.2 Kompatibilität verbessert; + Improve PHP 8.2 compatibility; + + PT-12973 - Verbessert das Schreiben der Log-Datei bei Produktbilderimporten; PT-12973 - Improve writing of log file during product image imports;