Product CSV Import - Placeholder wrong interpreted

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Product CSV Import - Placeholder wrong interpreted

Post by Moritz » 08 Dec 2022, 15:41

For my product import I use the following config for imported files.

config.png
config.png (1.85 KiB) Viewed 7096 times

In earlier versions of aimeos it works like expected.
Now I get this directory name for the placeholders.

archive.png
archive.png (2.69 KiB) Viewed 7096 times
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Re: Product CSV Import - Placeholder wrong interpreted

Post by Moritz » 09 Dec 2022, 13:43

I debugged it with an example path and output the different parts.
I don't know exactly what is happening and going wrong here.
Maybe you can say more about it.

strtime.png
strtime.png (66.04 KiB) Viewed 7082 times
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

Moritz
Advanced
Posts: 153
Joined: 07 Nov 2018, 14:05

Re: Product CSV Import - Placeholder wrong interpreted

Post by Moritz » 09 Dec 2022, 13:57

I got it.
Your documentation is wrong https://aimeos.org/docs/2022.x/cronjobs ... t/#backups
For the placeholders you reference to the strftime() function of PHP but you use DateTime::format here https://www.php.net/manual/en/datetime.format.php
Ubuntu 22.04.01
PHP 7.4.30
Typo3 v11.5.21 LTS
Aimeos web shop 22.10.4-pre3

User avatar
aimeos
Administrator
Posts: 8262
Joined: 01 Jan 1970, 00:00

Re: Product CSV Import - Placeholder wrong interpreted

Post by aimeos » 09 Dec 2022, 14:29

Thanks for pointing that out!

As strftime() is deprecated since PHP 8.1, date_format() is used instead and we've added a compatibility layer so some strftime() placeholders like "%Y", "%m", "%d" and "%H" are understood but up to now not "%M" and "%S". The later two are now translated to "%i" and "%s" automatically:
https://github.com/aimeos/aimeos-base/b ... #L220-L230

Also, the documentation has been updated so the date_create() placeholders should be now used instead:
https://aimeos.org/docs/latest/cronjobs ... t/#backups
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply