Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options are missing after import for mapped attributes #698

Open
andriydeveloper opened this issue Jul 12, 2024 · 0 comments
Open

Options are missing after import for mapped attributes #698

andriydeveloper opened this issue Jul 12, 2024 · 0 comments

Comments

@andriydeveloper
Copy link

Environment and configuration

  1. Magento 2.4.6-p6
  2. PHP 8.2
  3. MariaDB 10.6.18
  4. akeneo/module-magento2-connector-community 104.3.2 (also tested with 104.3.9)
  5. Akeneo 7

Steps to reproduce

  1. Create any Akeneo attribute for example "Connector" (different CamelCase) with option variants
  2. Create any Magento attribute for example "connector" (different CamelCase) with option variants
  3. Try to import

Expected result

  1. All options should be imported from Akeneo to Magento

Actual result

There is a bug with MySQL query in the file:
vendor/akeneo/module-magento2-connector-community/Job/Option.php
method mapOptions

There are 2 lines
1 . $connection->delete($tmpTable, ['attribute = ?' => $magentoAttribute]);
2. $options = $connection->select()->from($tmpTable)->where('attribute = ?', $akeneoAttribute);
image

When $magentoAttribute and $akeneoAttribute parameters have the same value with different CamelCase the first line just deletes everything and you have no data for $options

The possible solution is making the query sensitive for CamelCase
for example:
$connection->delete($tmpTable, ['BINARY attribute = ?' => $magentoAttribute]);
and after getting options delete it from the $tmpTable table in the database to prevent duplicates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant