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

Using "Since last successful import" option, ignores the last successful import date. #657

Open
robinero opened this issue Aug 30, 2023 · 7 comments
Labels
echoes/effort: L High effort changes (M * 2)

Comments

@robinero
Copy link

Environment and configuration

  1. Magento 2.4.6-p2
  2. Akeneo connector 104.0.0
  3. Akeneo 6.x

Steps to reproduce

  1. Set Updated mode to "Since last successful import"
  2. Run bin/magento akeneo_connector:import --code=product (or schedule the job)

Expected result

  1. Akeneo connector should only import products since last successful executed date.

Actual result

  1. Akeneo connector imports all products.

When running the connector the "last successful executed date" is set per family by the following code:
https://github.com/akeneo/magento2-connector-community/blob/v104.0.0/Executor/JobExecutor.php#L356

This line of code uses date('y-m-d H:i:s');, which will use a two digit year format.
The Akeneo API however expects a 4 digit year format:
https://api.akeneo.com/documentation/filter.html#on-their-creation-or-update-date.

This normally wouldn't be a problem when inserting this value in a datetime column,
but last_success_executed_date uses text to allow saving the JSON format:
https://github.com/akeneo/magento2-connector-community/blob/v104.0.0/etc/db_schema.xml#L80

To fix this, simply replace date('y-m-d H:i:s'); with date('Y-m-d H:i:s'); for the following:

Using the same format, the following should probably also be changed:

@rbouma
Copy link

rbouma commented Sep 8, 2023

We have same problem, thanks for sorting out @robinero Hope this will be fixed soon. for time being we will create composer patch for this.

@Bartlomiejsz
Copy link

Fyi @robinero, I created PR for this issue some time ago but it wasn't yet merged - #646

@robinero
Copy link
Author

@Bartlomiejsz, bit stupid of me, I only checked the PRs after creating the issue.

Although I'm not sure if Akeneo merges PRs, so here's hoping they do after seeing this issue.

@robinero
Copy link
Author

robinero commented Dec 8, 2023

Issue still exists in v104.0.7.

@rbouma2
Copy link

rbouma2 commented Jun 12, 2024

@magentix @Dnd-Gimix or someone else, please merge the fix in #646. Its not that hard? There is a bug, the solution is presented, but still, nobody has merged it. This issue is really annoying to apply a patch to every customer.

Edit:
Sorry for my bad language, it is frustrating that these simple fixes takes ages to get merged.

@thanninger
Copy link

Yes please merge the fix @magentix @Dnd-Gimix . Our imports take over 4 hours without the "last successful import" option.

@magentix
Copy link
Collaborator

magentix commented Sep 25, 2024

Hello,

The fix will be included in 104.3.14.

@magentix magentix added the echoes/effort: L High effort changes (M * 2) label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes/effort: L High effort changes (M * 2)
Projects
None yet
Development

No branches or pull requests

6 participants