REST api 4.2 varianten - Duplicate entry '46-Object' for key

GELÖST: optionId statt option…!!! :wink: hallo. ich kämpfe nun seit längeren mit der rest api und dem versuch, varianten artikel anzulegen. erst nach einer scheinbar älteren anleitung, die hier zu erst kommt http://wiki.shopware.de/Shopware-4-REST … 9_869.html dann auch testweise nach der mit vartianten endpunkt http://wiki.shopware.de/Shopware-4-REST … rce_ab_4.2 problem blöeibt leider bestehen. [quote][“httpCode”]=> int(500) [“result”]=> array(2) { [“success”]=> bool(false) [“message”]=> string(266) “Errormesage: An exception occurred while executing ‘INSERT INTO s_article_configurator_options (group_id, name, position) VALUES (?, ?, ?)’ with params [46, {}, 0]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘46-Object’ for key ‘group_id’” } }[/quote] was mich da besonders sutzig macht: ich arbeite extra mit den id’s, damit das nicht mehr passiert. [quote]‘configuratorOptions’ => array( array(‘groupId’ => 46, ‘option’ => $theColorsArr[utf8_encode($color)]), array(‘groupId’ => 47, ‘option’ => $theSizesArr[$size]), ),[/quote] daher sind in denarrays die mappings auf die vorher angelegten id’s. warum versucht shopware also die optionen noch einmal anzulegen? edit: log liest sich so [quote]SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘46-Object’ for key ‘group_id’’ in I:\shopware42\Uwamp\www\engine\Shopware\Components\Api\Resource\Resource.php:260 Stack trace: #0 I:\shopware42\Uwamp\www\engine\Shopware\Components\Api\Resource\Variant.php(280): Shopware\Components\Api\Resource\Resource->flush() #1 I:\shopware42\Uwamp\www\engine\Shopware\Controllers\Api\Variants.php(68): Shopware\Components\Api\Resource\Variant->create(Array) #2 I:\shopware42\Uwamp\www\engine\Library\Enlight\Controller\Action.php(159): Shopware_Controllers_Api_Variants->postAction() #3 I:\shopware42\Uwamp\www\engine\Library\Enlight\Controller\Dispatcher\Default.php(528): Enlight_Controller_Action->dispatch(‘postAction’) #4 I:\shopware42\Uwamp\www\engine\Library\Enlight\Controller\Front.php(228): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp)) #5 I:\shopware42\Uwamp\www\engine\Shopware\Kernel.php(141): Enlight_Controller_Front->dispatch() #6 I:\shopware42\Uwamp\www\vendor\symfony\http-kernel\Symfony\Component\HttpKernel\HttpCache\HttpCache.php(473): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #7 I:\shopware42\Uwamp\www\engine\Shopware\Components\HttpCache\AppCache.php(256): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #8 I:\shopware42\Uwamp\www\vendor\symfony\http-kernel\Symfony\Component\HttpKernel\HttpCache\HttpCache.php(244): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true) #9 I:\shopware42\Uwamp\www\vendor\symfony\http-kernel\Symfony\Component\HttpKernel\HttpCache\HttpCache.php(261): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true) #10 I:\shopware42\Uwamp\www\engine\Shopware\Components\HttpCache\AppCache.php(132): Symfony\Component\HttpKernel\HttpCache\HttpCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true) #11 I:\shopware42\Uwamp\www\vendor\symfony\http-kernel\Symfony\Component\HttpKernel\HttpCache\HttpCache.php(190): Shopware\Components\HttpCache\AppCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true) #12 I:\shopware42\Uwamp\www\engine\Shopware\Components\HttpCache\AppCache.php(113): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 I:\shopware42\Uwamp\www\shopware.php(91): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request)) #14 {main} {“uid”:“760769d”} [2014-05-27 15:58:10] core.ERROR: exception ‘Shopware\Components\Api\Exception\OrmException’ with message 'An exception occurred while executing ‘INSERT INTO s_article_configurator_options (group_id, name, position) VALUES (?, ?, ?)’ with params [46, {}, 0]: [/quote] edit 2: update auf 4.2.3 hat auch nicht geholfen

post92263.html#p92263 object taucht hier auch in der db auf. und das mag er nicht.

Das Problem tritt bei uns auch noch immer auf, ich habe bereits über Github einen Pull-Request gestartet, dass Problem lässt sich im Core über 1 Zeile im Prinzip lösen: https://github.com/ShopwareAG/shopware-4/pull/149 Das System sollte nämlich eigentlich auch funktionieren, wenn die IDs nicht parat liegen (so wie in deinem Lösungsansatz), sondern nur der Bezeichner. Das ist an allen anderen Stellen auch immer so gemacht, und bei den Optionen/Gruppen eigentlich auch. Wie gesagt - das Problem habe ich ebenfalls im jira- Tracker hinterlegt, ich würde mich freuen, wenn das problem noch ein paar weitere unterstützen, damit wenigstens unter 4.3 das Problem beseitigt wird! jira- Verweis: http://jira.shopware.de?ticket=SW-8630 Schöne Grüße! Niklas

** PUSH Gibts dafür eine Lösung?