1

Trying to add some related / cross-sell and upsells to products in the admin but receiving the following error after saving the product:

The linked products data is invalid. Verify the data and try again.

I checked my exception log and saw this:

main.CRITICAL: The linked products data is invalid. Verify the data and try again. {"exception":"[object] (Magento\\Framework\\Exception\\CouldNotSaveException(code: 0): The linked products data is invalid. Verify the data and try again. at /srv/public_html/vendor/magento/module-catalog/Model/ProductLink/Repository.php:141)"} []

What could be the issue here?

  • did it happen to all or only for specific products? – fmsthird Apr 23 at 21:10
  • I haven't tested every product but so far every product we've tried we receive that error when trying to assign a related / upsell / crossell product – AJ47 Apr 23 at 21:15
  • did you chrck this magento.stackexchange.com/questions/147183/… – fmsthird Apr 23 at 21:20
  • 1
    oh I see, I'll try that.. both of my tables are empty as that comment describes – AJ47 Apr 23 at 21:48
2

I was able to fix this:

First check the following tables in your DB:

catalog_product_link_attribute and catalog_product_link_type

If those are empty, you need to run the following SQL queries:

INSERT INTO `catalog_product_link_attribute` (`product_link_attribute_id`, `link_type_id`, `product_link_attribute_code`, `data_type`) VALUES
(1, 1, 'position', 'int'),
(2, 4, 'position', 'int'),
(3, 5, 'position', 'int'),
(4, 3, 'position', 'int'),
(5, 3, 'qty', 'decimal');

INSERT INTO `catalog_product_link_type` (`link_type_id`, `code`) VALUES
(1, 'relation'),
(3, 'super'),
(4, 'up_sell'),
(5, 'cross_sell');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.