Pim-community-dev: Update of product with variant axis not possible

Created on 28 Aug 2018  ·  12Comments  ·  Source: akeneo/pim-community-dev

Since Version 2.3.5 it's not possible to update a product variant.

The problem lies in the isEqual(ValueInterface $value) method in the AbstractValue-Class (src/Pim/Component/Catalog/Model/AbstractValue.php). The first equal $this->getData() === $value->getData() in Line 60 will only be true if both are the same references to the same instance of the same class, which should be never the case. So in this case the comparison operator has to be used instead of the identity operator.

The logical error was introduced in the commit 3e652c2820639e6b7192292644273bb2d97d2b85.

akeneo-pim-system-info_2018-08-28_11_14.txt

bug

Most helpful comment

Indeed I can now reproduce it! Thanks. It might be related to the type of attribute used as a variant axis. Currently I can only see the error when the type is "metric".

All 12 comments

Hello @simonkey,

Thanks for raising this issue, can you tell us how we can easily reproduce the issue?
I've tried to update product variants on our demo environment and it's working fine.
(Our demo env is now on 2.3.6 version).

Thanks!

It's happening on the demo. We can see it here:
http://demo.akeneo.com/#/enrich/product/1240

I already updated to the 2.3.6, but this didn't fixed it.

Hey @fjlenatz,

Thanks for the nice report. @LaureBro and me (separatly) tried to reproduce this on the demo, but everything seems to work as we were expecting it to.

Maybe we don't follow the same scenario. Can you provide a step by step scenario on the demo with your actions and expectations?

Thanks.

Hi!

1) Create a product model of LED TV and set the LED TV variant.
2) Create a product with that variant.
3) It will be created, but when you try to edit it or save again, you'll see the error.

In the product I sent before you can see it. Another example:
http://demo.akeneo.com/#/enrich/product/1242

In the default demo set it is the Product model TV SAMSUNG (identifier samtv) in the family "LED TVs". When you try to update something in one of the existing variants the error Variant axis "display_diagonal" cannot be modified, ... occurs and the product cannot be saved/updated.

Thanks for the details :) I'll test this right away!

Indeed I can now reproduce it! Thanks. It might be related to the type of attribute used as a variant axis. Currently I can only see the error when the type is "metric".

Yes, it seems that the error occurs only if "metric" is used.

I also confirm, this is indeed a bug, thanks for reporting it!
Would you like to contribute and fix it?
Here's our contribution guide: https://docs.akeneo.com/2.3/contribute_to_pim/contribution_guide.html#how-to-submit-a-patch-to-the-pim
Let me know if you'd like to make a PR, and if so, if you need help.
If you don't feel like contributing, no problem, we'll add this issue in our bug tracker and fix it ASAP.

Hello @simonkey, @fjlenatz,

This issue will be handled by our maintenance team very soon, I have removed it from the Wanna contribute project. I will keep you updated.

Hi @simonkey & @fjlenatz,

Here is the PR with the fix: https://github.com/akeneo/pim-community-dev/pull/8872
It will be merge during the day and the fix will be available in the next tag of the 2.3 :)

Have a good day !

Hello, this issue is fixed in the latest 2.3 patch: 2.3.9.
I'm closing this issue.
Kind regards,
Laure

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lpxavi picture lpxavi  ·  3Comments

ronthedrummer picture ronthedrummer  ·  3Comments

FabienSalles picture FabienSalles  ·  5Comments

Jacky75 picture Jacky75  ·  3Comments

Piotr-Borek picture Piotr-Borek  ·  5Comments