Liebes SW Team,
leider bekommen wir häufig von Kunden Probleme gemeldet, dass das Plugin „FriedmOrderlistInvoiceNr“ mit „Custom Products“ nich kompatibel sein.
Folgender Fehler wird ausgegeben:
Fatal error: Uncaught TypeError: Argument 1 passed to SwagCustomProducts\Subscriber\Backend::shouldDisplayCustomOptionDetails() must be of the type array, null given, called in /html/shopware/testserver/custom/plugins/SwagCustomProducts/Subscriber/Backend.php on line 177 and defined in /html/shopware/testserver/custom/plugins/SwagCustomProducts/Subscriber/Backend.php:218 Stack trace: #0 /html/shopware/testserver/custom/plugins/SwagCustomProducts/Subscriber/Backend.php(177): SwagCustomProducts\Subscriber\Backend->shouldDisplayCustomOptionDetails(NULL) #1 /html/shopware/testserver/custom/plugins/SwagCustomProducts/Subscriber/Backend.php(91): SwagCustomProducts\Subscriber\Backend->assignAttributes(Array) #2 /html/shopware/testserver/engine/Library/Enlight/Event/Handler/Default.php(91): SwagCustomProducts\Subscriber\Backend->extendOrderModule(Object(Enlight_Controller_ActionEventArgs)) #3 /html/shopware/testserver/engine/Library/Enlight/Event/EventManager.php(220): Enlight_Event_Handler_Default->execute(Object(Enlight_Control in /html/shopware/testserver/custom/plugins/SwagCustomProducts/Subscriber/Backend.php on line 218
Ich konnte das Problem ermittel und hoffe, dass ihr euer Plugin anpasst.
SwagCustomProducts/Subscriber/Backend.php
[166] $attributes = $this->loadAttributes($ids);
Man erhält nun folgendes Array:
Array
(
[158563] => Array
(
[0] => Array
(
[swag_custom_products_configuration_hash] =>
[swag_custom_products_mode] => 0
)
),
[158566] => Array
(
[0] => Array
(
[swag_custom_products_configuration_hash] =>
[swag_custom_products_mode] => 0
)
),
...,
[160000] => Array
(
),
[160001] => Array
(
)
)
Ja, der Eintrag 160000 und 160001 ist leer und verursacht nun folgendes Problem:
[171]
if (!isset($attributes[$id])) {
continue;
}
$attributes[160000] ist vorhanden aber leer. Dennoch wird der Datensatz verarbeitet.
[177] if (!$this->shouldDisplayCustomOptionDetails($attribute)) {
Fehler wird ausgegeben.
BITTE
Zeile 177 anpassen:
if (!isset($attributes[$id]) || empty($attributes[$id])) {
continue;
}
Vielen Dank