From 72ee406708bfaa53fbc0217ebb5df297579beeba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 11 Feb 2022 15:08:49 +0100 Subject: [PATCH] Shopware: Bessere Fehlermeldung, dass Titel nur 255 Zeichen haben darf --- SL/ShopConnector/Shopware6.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SL/ShopConnector/Shopware6.pm b/SL/ShopConnector/Shopware6.pm index 79a709c71..980923ef7 100644 --- a/SL/ShopConnector/Shopware6.pm +++ b/SL/ShopConnector/Shopware6.pm @@ -180,7 +180,11 @@ sub update_part { } undef $update_p->{partNumber}; # we dont need this one $ret = $self->connector->PATCH('api/product/' . $one_d->{id}, to_json($update_p)); - die "Updating part with " . $part->partnumber . " failed: " . $ret->responseContent() unless (204 == $ret->responseCode()); + unless (204 == $ret->responseCode()) { + die t8('Part Description is too long for this Shopware version. It should have lower than 255 characters.') + if $ret->responseContent() =~ m/Diese Zeichenkette ist zu lang. Sie sollte.*255 Zeichen/; + die "Updating part with " . $part->partnumber . " failed: " . $ret->responseContent() unless (204 == $ret->responseCode()); + } } else { # create part # 1. get the correct tax for this product -- 2.20.1