News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Saving parent change product alias existing child 3.2.8

Started by ronald@aava.nl, December 14, 2017, 15:21:36 PM

Previous topic - Next topic

ronald@aava.nl

Hi,

Issue after update from 3.2.4 to 3.2.8

Save a new product, this is the parent.
Add child product.
Change product name and product alias from the child and save.
So far so good!

Save again the parent.
This overrides the product alias from the child  >:(

Multilang
VM 3.2.8
Joomla 3.8.3
PHP Version 7.0.14

Tested in vm 3.2.4 / Joomla 3.8.1 it works ok  :)

Regards Ronald




aftertaf


ronald@aava.nl

Are there solutions?
I can not imagine that this is the standard from VM 3.2.8

Jörgen

Hello

I am almost sure that this has is not something new. The parent has the Child alias and Product name stored in one of the tabs. If You change the Child and have the parent open in another tab, storing the parent vill overwrite the changed data in the child. These data are overlapping and this does happen in older VM versions. Updating the parent view and then make the changes necessary to the parent will eliminate this behaviour.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Milbo

I have really big trouble to reproduce or even theoretically to think through it.

First, slugs are unique! on db level! that means that the db itself (mysql or mariadb) blocks to insert or to update a line so that you cannot get two identical slugs.

So a child must have only one thing which must be different to a parent and that is the slug. When I create a parent and call it "My parent test" and store it, the slug is set to "my-parent-test". When I create then a new child for the parent I get automatically redirected to the child. The child got already stored, for that i had to write a slug generator, which adds a -1 or increases this number. So my child has already the slug "my-parent-test-1".

When I store now my child, I have no clue how that should change my parent. Just to be sure, I just did that and as expected, nothhing happened.

So I wonder how you get your result. When you create a new product and you do not store it and directly use the "create a child",... hmm I see it is grey and cannot be pressed ...

So I have really no clue. Even Jörgs explanation cannot work, because the only thing which never can be inherited (except for automatic slug generation) is the slug.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ronald@aava.nl

Hi Thanks for your attention.

Quote from: Milbo on December 18, 2017, 16:20:41 PM
When I store now my child, I have no clue how that should change my parent. Just to be sure, I just did that and as expected, nothhing happened.


The child does not override the slug of the parent, it is reverse.

Please try as descripted:

Add and save a new product named test5, this is the parent with slug test5.
Add child product, automatically it is named test5 with slug test5-1
Change child product name to test500 and child product alias to test500 and save.
So far so good!

Save again the parent.
This overrides the child product alias from test500 to test5-1

Regards
Ronald






Milbo

Quote from: ronald@aava.nl on December 18, 2017, 17:54:10 PM
So far so good!

Save again the parent.
This overrides the child product alias from test500 to test5-1

and here is a missing step for me. When I want todo that, I need to reopen the parent product. When you do not reopen it, because you create a second tab creating the child, then please take a look on the "child products" tab.

There you an see the name, gtin, price of the child. You can directly change the name of the child there. But not the slug.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

aftertaf

#7
what i've seen is that making ANY change to the parent product then saving causes the alias of each child product to become that of the parent product, plus -1, -2, etc...


Check the screenshots in the order of date...
i opened a child, then opened the parent, then modified the parent then reopened the child.
Alias (therefore SEF) changed...
happened when move from 3.2.6 to 3.2.8.

and only happens in one of the two languages, the one active at the time.
when i switch to 2nd language the alias is unchanged..


Studio 42

I think the error is in the check slug function, Because i don't develop anymore the core, max need to check the changes he do about this.
Certainly he removed the product ID check from alias check function.
In vm batch product editor, i always exclude the alias from product id to check, to not have this problem on update.

Jörgen

Yepp

I can confirm this. The behaviour I described earlier does not match the behaviour of VM3.2.10 and probably also VM3.2.8.
Now I have tested it on VM 3.2.10 and saving the parent renames the slugs of the Children to parent-slug-1, parent-slug-2 and so on ...

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Milbo

hmmm looks like the problem is in product model line 2245


if(empty($child['slug'])){
$child['slug'] = $data['slug'];
}


The idea was, that an empty slug is prefilled with the name of the parent, to prevent the error, that no slug could be found. This is quite important for the multichild variants, when you have more than 40 children. But without the Childmultivariant, no slug is given and so always overridden. Damn.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/


ronald@aava.nl

Hi Max,

Is there a solution or have i missed it?

Thanks in advance,

Ronald

Jörgen

There will be a new official release within the next few days that adresses this issue.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.