aimeos / ai-admin-jqadm

Aimeos e-commerce Vue.js+Bootstrap based admin interface
https://aimeos.org
GNU Lesser General Public License v3.0
182 stars 43 forks source link

A new duplicated product item can be saved with the same URL without an error message #271

Closed akropivko closed 1 year ago

akropivko commented 1 year ago

Environment Version - 2023.07 Integration - Laravel System - Windows10

Describe the bug A new duplicated product item can be saved with the same URL without any error message. So we can have 2 product items with the same URL.

To Reproduce

  1. Product list, duplicate any "select" type item
  2. Save the new (duplicated) product item without changing its URL.

Expected behavior Some error message should be displayed to prevent saving a new product with existed URL

aimeos commented 1 year ago

The URL isn't unique and nobody enforces this, that's true. It's also not strictly an error to have an old and a new product sharing the same URL, so maybe a warning would be the better option if the order is well defined. When copying an item, we could also add a "2" at the end of the URL to make it unique. What do you think?

akropivko commented 1 year ago

Having two or more products sharing the same URL may lead to an issue where the stock values of one of the products are unexpectedly set to null. I have encountered this problem a couple of times, but unfortunately, I have not been able to reproduce it consistently for an issue report. It appears to me that adding a '2' or maybe something similar to what you have done for the SKU, would be good. Thanks

aimeos commented 1 year ago

The product label now gets the same hash as the code. This ensures that the product URL will get it too if no other values is entered but a product can still have the same URL if the original product contains a text of type "URL segment" for different languages.

aimeos commented 1 year ago

The stock level of the products is never copied and will be always 0 if not changed and we think this is the correct behavior.