Hallo.
Beim Versuch einen Kunden per API zu erstellen bekomme ich die Rückmeldung „Internal Server Error“. Darauf hin machte ich mich auf dem Server auf die Suche und fand folgenden Fehler:
[2022-10-26T11:57:15.010558+00:00]
php.CRITICAL: Uncaught Error: Shopware\Core\Framework\DataAbstractionLayer\Write\DataStack\KeyValuePair::__construct():
Argument #1 ($key) must be of type string, int given, called in /var/www/html/sw6/vendor/shopware/core/Framework/DataAbstractionLayer/Write/DataStack/DataStack.php on line 47
{"exception":"[object] (TypeError(code: 0): Shopware\\Core\\Framework\\DataAbstractionLayer\\Write\\DataStack\\KeyValuePair::__construct():
Argument #1 ($key) must be of type string, int given, called in /var/www/html/sw6/vendor/shopware/core/Framework/DataAbstractionLayer/Write/DataStack/DataStack.php on line 47
at /var/www/html/sw6/vendor/shopware/core/Framework/DataAbstractionLayer/Write/DataStack/KeyValuePair.php:22)"} []
[2022-10-26T11:57:15.012620+00:00]
request.CRITICAL: Uncaught PHP Exception TypeError: "Shopware\Core\Framework\DataAbstractionLayer\Write\DataStack\KeyValuePair::__construct():
Argument #1 ($key) must be of type string, int given, called in /var/www/html/sw6/vendor/shopware/core/Framework/DataAbstractionLayer/Write/DataStack/DataStack.php on line 47"
at /var/www/html/sw6/vendor/shopware/core/Framework/DataAbstractionLayer/Write/DataStack/KeyValuePair.php line 22 {"exception":"[object]
(TypeError(code: 0): Shopware\\Core\\Framework\\DataAbstractionLayer\\Write\\DataStack\\KeyValuePair::__construct():
Argument #1 ($key) must be of type string, int given, called in /var/www/html/sw6/vendor/shopware/core/Framework/DataAbstractionLayer/Write/DataStack/DataStack.php on line 47
at /var/www/html/sw6/vendor/shopware/core/Framework/DataAbstractionLayer/Write/DataStack/KeyValuePair.php:22)"} []
Meine Post Request lautet wie folgt:
{
"salutationId": "364b71461d1f4964b8a5c0b1f4f8b2c4",
"firstName": "Max",
"lastName": "Mustermann",
"email": "m.mustermann@test.de",
"groupId": "48593cd5265449569df8db89c3d59c86",
"defaultPaymentMethodId": "dd9300ea3cce442f96ce1b9c5e7b4cf4",
"active": true,
"salesChannelId": "955cb010182245f694209c29cbba691d",
"customerNumber": "KT000001",
"password": "StrengGeheim42",
"defaultBillingAddress": [
{
"salutationId": "364b71461d1f4964b8a5c0b1f4f8b2c4",
"firstName": "Max",
"lastName": "Mustermann",
"street": "Musterstraße 1",
"zipcode": "12345",
"city": "Musterstadt",
"countryId": "d64e0bc7cf6440a1ae4e54c33e56fe96"
}
],
"defaultShippingAddress": [
{
"salutationId": "364b71461d1f4964b8a5c0b1f4f8b2c4",
"firstName": "Max",
"lastName": "Mustermann",
"street": "Musterstraße 1",
"zipcode": "12345",
"city": "Musterstadt",
"countryId": "d64e0bc7cf6440a1ae4e54c33e56fe96"
}
]
}
Erst hatte ich keine defaultShippingAddress weil ich davon ausging er nimmt die defaultBillingAddress. Dann fügte ich aber eine ein. Das Problem bleibt.
Die Fehlermeldung sagt auch was von „must be of type string, int given“ aber ich übergeben niergends Strings. Ist das ein interner Bug?