mediamanDE / magento-module-wishlist-api

Adds an API to interact with the Magento2 wishlist.
MIT License
18 stars 9 forks source link

Add an item from the customers wishlist producing error #10

Open gnanasekaranl opened 6 years ago

gnanasekaranl commented 6 years ago

Add an item from the customers wishlist endpoint producing below error with magento 2.2

Request URL : http://192.168.0.42/magento-2.2/rest/all/V1/wishlist/MT07

MT07 -- SKU

Response Body { "message": "Internal Error. Details are available in Magento log file. Report ID: webapi-5aea5a58ddd60" } Response Code 500

In var/log/exception.log below error log you can find.

[2018-05-02 23:14:07] main.CRITICAL: Report ID: webapi-5aea463fde7e2; Message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (magento-2-2.wishlist, CONSTRAINT WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID FOREIGN KEY (customer_id) REFERENCES customer_entity (entity_id) ON DELETE CASCADE), query was: INSERT INTO wishlist (updated_at) VALUES ('2018-05-02 23:14:07') {"exception":"[object] (Exception(code: 23000): Report ID: webapi-5aea463fde7e2; Message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (magento-2-2.wishlist, CONSTRAINT WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID FOREIGN KEY (customer_id) REFERENCES customer_entity (entity_id) ON DELETE CASCADE), query was: INSERT INTO wishlist (updated_at) VALUES ('2018-05-02 23:14:07') at /var/www/html/magento-2.2/vendor/magento/framework/Webapi/ErrorProcessor.php:205, Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (magento-2-2.wishlist, CONSTRAINT WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID FOREIGN KEY (customer_id) REFERENCES customer_entity (entity_id) ON DELETE CASCADE), query was: INSERT INTO wishlist (updated_at) VALUES ('2018-05-02 23:14:07') at /var/www/html/magento-2.2/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (magento-2-2.wishlist, CONSTRAINT WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID FOREIGN KEY (customer_id) REFERENCES customer_entity (entity_id) ON DELETE CASCADE) at /var/www/html/magento-2.2/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []

R4c00n commented 6 years ago

Hello @gnanasekaranl, thank you for reporting this issue. I forgot to tag the latest commit of the master branch. Please upgrade to version 1.0.1 and let me know if your issue is resolved there.

gnanasekaranl commented 6 years ago

@R4c00n Added product in wishlist by API not displaying in front end for the same user login.