akeneo / magento2-connector-community

Akeneo Connector for Magento 2
Open Software License 3.0
80 stars 87 forks source link

Product Completeness type not working with conditions #690

Open mautz-et-tong opened 2 months ago

mautz-et-tong commented 2 months ago

Environment and configuration

  1. PHP 8.1.21
  2. Magento 2: 2.4.4-p7
  3. akeneo/module-magento2-connector-community: 104.3.5
  4. Akeneo: 6.0.105

Steps to reproduce

  1. Configure Filter Products -> Product Completeness type to Greater than, Product Completeness value to 99
  2. Ensure you have a valid product in Akeneo that has updated attributes, is in a family that will be imported and has a completeness level of 100.
  3. Run the Product Import job in the Magento2 backend

Expected result

The product should be updated in Magento2

Actual result

The product is not being updated as the job says "completed No results from Akeneo for the family: XYZ"

I debugged the filter and it shows like this:

[
    [0] => [
            [search] => [
                    [completeness] => [
                            [0] => [
                                    [operator] => >
                                    [value] => 99
                                    [scope] => ecommerce
                             ]
                    ]
                    [family] => [
                            [0] => [
                                    [operator] => IN
                                    [value] =>[
                                            [0] => XYZ
                                     ]
                                ]
                        ]
                ]
            [scope] => ecommerce
            [locales] => de_DE
        ]
    [...]
    [3] => [
            [search] => [
                    [completeness] => [
                            [0] => [
                                    [operator] => >
                                    [value] => 99
                                    [scope] => DEF
                                ]
                        ]
                    [family] => [
                            [0] => [
                                    [operator] => IN
                                    [value] => [
                                            [0] => XYZ
                                       ]
                                ]
                        ]
                ]
            [scope] => fensterhai
            [locales] => de_DE
        ]
]

and the product list has a count of 0 and no product is being updated.

When I use "No condition" as completeness_type the debug log shows:

[
    [0] => [
            [search] => [
                    [family] => [
                            [0] => [
                                    [operator] => IN
                                    [value] => [
                                            [0] => [
                                                    [code] => XYZ
                                                    [attributes] => [
                                                            [0] => application
                                                            [...]
                                                            [66] => width
                                                            [67] => working_temperature
                                                        ]
                                                    [attribute_as_label] => test_name
                                                    [attribute_as_image] => example_image
                                                    [attribute_requirements] => [
                                                            [ecommerce] => [
                                                                    [0] => delivery_time
                                                                    [...]
                                                                    [14] => sku
                                                                ]
                                                            [store1] => [
                                                                    [0] => delivery_time
                                                                    [...]
                                                                    [14] => sku
                                                                ]
                                                            [store2] => Array
                                                                [
                                                                    [0] => delivery_time
                                                                    [...]
                                                                    [14] => sku
                                                                ]
                                                            [store3] => Array
                                                                [
                                                                    [0] => delivery_time
                                                                    [...]
                                                                    [14] => sku
                                                                ]
                                                        ]
                                                    [labels] => Array
                                                        [
                                                            [de_DE] => Testlabel
                                                        ]
                                                ]
                                        ]
                                ]
                        ]
                ]
            [scope] => ecommerce
            [locales] => de_DE
        ]
[...]

and the product is being updated

As already the debugged filter differs, I decided to open the issue in this project and not in the Akeneo PIM repo. I checked the diff between the current module version and the last patch version and the used Akeneo Version with the last release in that major version. There is no hint that updating to lastest versions in the major version we are using solves this.