New product build with data set - remove attribute error

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Doggiefield
Posts: 18
Joined: 13 May 2020, 13:07

New product build with data set - remove attribute error

Post by Doggiefield » 10 Jun 2020, 15:39

We are using Aimeos 2019-10

First I will explain the situation:
We use product datasets to add a new product. This way we are sure that no attribute or other setting is forgotten.
We use the product data set like this:

Code: Select all

	"Title1": {
		"product": {
			"product.type": "select"
		},
		"selection": [
			{"variant": [{}]
			}
		],
		"text": [
			{"text.type": "short","text.content":"Product USP 1<br />Product USP 2<br />"},
			{"text.type": "long"},
			{"text.type": "meta-description"},
			{"text.type": "meta-title"}
		],
		"stock": [
			{"stock.type": "default"}
		],
		"catalog": {
			"default": [{}]
        },
		"characteristic": {
			"attribute": [
				{"attribute.type": "property-1"},
				{"attribute.type": "property-2"},
				{"attribute.type": "property-3"},
				{"attribute.type": "property-4"},
				{"attribute.type": "property-5"},
				{"attribute.type": "property-6"},
				{"attribute.type": "property-7"},				
				{"attribute.type": "property-8"},
				{"attribute.type": "property-9"},
				{"attribute.type": "property-10"}
			]
		},
		"supplier":{
			"default": [{}]
		}    
    },
In some cases we don't have the data for a specific attribute. So we want to remove that attribute from the list.
When I go the the characteristics and try to remove attribute property-3 then the lowest attribute is removed. (property-10).
This is very frustrating for the people who are adding the products in the backend.

The only way to solve this at this moment is to fill in the attribute and save the product and then remove the attribute.
Is there another way that we can remove the right attribute without having to remove all attributes and add them again?

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: New product build with data set - remove attribute error

Post by aimeos » 11 Jun 2020, 11:09

Seems like a bug in the JS code. Can you investigate what exactly happens and why the wrong one is removed?
https://github.com/aimeos/ai-admin-jqad ... p#L58-L110

Do your editors resort the attributes before removing one? This is known to be problematic because of patching the HTML nodes in Vue.js when updating them instead of removing/readding them.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Doggiefield
Posts: 18
Joined: 13 May 2020, 13:07

Re: New product build with data set - remove attribute error

Post by Doggiefield » 11 Jun 2020, 12:25

We can't resort the items because the product isn't saved yet.
It also happens when creating a new product with attributes. As you can see in the attached screenshot:

I tried to remove the second attribute and the botom one "color" is removed
Attachments
Removing-attibute.png
Removing-attibute.png (9.02 KiB) Viewed 15163 times

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: New product build with data set - remove attribute error

Post by aimeos » 13 Jun 2020, 12:07

We have been able to reproduce the problem but are not able to fix it. Others had that problem too:
https://stackoverflow.com/questions/525 ... -from-last

It seems that the Vue.js code updates the items before removing them. It does only occur for attributes, not for properties because the implementation there is based on Vue components. The only option seems to be implementing a component for for the attributes too (mid-term).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Doggiefield
Posts: 18
Joined: 13 May 2020, 13:07

Re: New product build with data set - remove attribute error

Post by Doggiefield » 13 Jun 2020, 13:56

Thanks,

It is not a big issue for us, I just thought it would be good to mention it here.
For now we will save the product first and remove the attribute(s) after saving.

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: New product build with data set - remove attribute error

Post by aimeos » 29 Sep 2023, 09:15

Product attribute sub-panel has been rewritten and this problem is now gone.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply