magento2-connector-community icon indicating copy to clipboard operation
magento2-connector-community copied to clipboard

Duplicate attribute value

Open JoostWan opened this issue 4 years ago • 1 comments

We had a issue with duplicate attribute values. The client used unique values in Akeneo but not for the language labels. The Akeneo import loops trough the stores based on languages. In this case the admin store used nl_NL as default language so the value of nl_NL is used and multiple options get 1 as value.

Screenshot 2020-03-27 at 22 10 44

Screenshot 2020-03-27 at 22 10 56

Array
(
    [nl_NL] => Array
        (
            [0] => Array
                (
                    [store_id] => 0
                    [store_code] => admin
                    [is_website_default] => 1
                    [siblings] => Array
                        (
                            [0] => 0
                        )

                    [website_id] => 0
                    [website_code] => admin
                    [channel_code] => ecommerce
                    [lang] => nl_NL
                    [currency] => EUR
                )

            [1] => Array
                (
                    [store_id] => 1
                    [store_code] => nl
                    [is_website_default] => 1
                    [siblings] => Array
                        (
                            [1] => 1
                            [7] => 7
                            [15] => 15
                            [4] => 4
                            [13] => 13
                            [12] => 12
                            [14] => 14
                            [8] => 8
                            [11] => 11
                            [9] => 9
                            [6] => 6
                            [10] => 10
                        )

                    [website_id] => 1
                    [website_code] => base
                    [channel_code] => ecommerce
                    [lang] => nl_NL
                    [currency] => EUR
                )
.....

For now i fix this by changing the next line https://github.com/akeneo/magento2-connector-community/blob/master/Job/Option.php#L358

with this:

'value' => ($store['website_id'] == 0) ? 'code' : 'labels-' . $local,

Now the admin value get's the code/admin value of the attribute from Akeneo.

Screenshot 2020-03-27 at 23 02 38

JoostWan avatar Mar 27 '20 22:03 JoostWan

Have the same issue.

oefterdal avatar Sep 17 '22 23:09 oefterdal