Subscription dateInterval error

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!
hansklatt
Posts: 20
Joined: 29 Jul 2021, 20:19

Subscription dateInterval error

Post by hansklatt » 29 Dec 2021, 01:28

Hello,
we have a TYPO3 V10 page with Aimeos 21.10.2, it runs with PHP 7.4.

I want to test the subscription function and i found in the log this error:

Unable to begin subscription with ID "30": DateInterval::__construct(): Unknown or bad format (P1H)

The scheduler cronjobs for subscriptions are activated, the data type from P1H is string.

What can i do?



Here is the complete error log for the subscription cronjob:

Unable to begin subscription with ID "30": DateInterval::__construct(): Unknown or bad format (P1H)
#0 /html/composer-installation/vendor/aimeos/ai-controller-jobs/controller/jobs/src/Controller/Jobs/Subscription/Process/Begin/Standard.php(153): DateInterval->__construct('P1H')
#1 /html/composer-installation/public/typo3conf/ext/aimeos/Classes/Scheduler/Base.php(62): Aimeos\Controller\Jobs\Subscription\Process\Begin\Standard->run()
#2 [internal function]: Aimeos\Aimeos\Scheduler\Base::Aimeos\Aimeos\Scheduler\closure(Object(Aimeos\MShop\Context\Item\Typo3), Object(Aimeos\Bootstrap), 'subscription/pr...')
#3 /html/composer-installation/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Pcntl.php(181): call_user_func_array(Object(Closure), Array)
#4 /html/composer-installation/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Pcntl.php(116): Aimeos\MW\Process\Pcntl->exec(Object(Closure), Array)
#5 /html/composer-installation/public/typo3conf/ext/aimeos/Classes/Scheduler/Base.php(65): Aimeos\MW\Process\Pcntl->start(Object(Closure), Array, false)
#6 /html/composer-installation/public/typo3conf/ext/aimeos/Classes/Scheduler/Task/Email6.php(90): Aimeos\Aimeos\Scheduler\Base::execute(Array, Array, Array, '345')
#7 /html/composer-installation/public/typo3/sysext/scheduler/Classes/Scheduler.php(182): Aimeos\Aimeos\Scheduler\Task\Email6->execute()
#8 /html/composer-installation/public/typo3/sysext/scheduler/Classes/Command/SchedulerCommand.php(259): TYPO3\CMS\Scheduler\Scheduler->executeTask(Object(Aimeos\Aimeos\Scheduler\Task\Email6))
#9 /html/composer-installation/public/typo3/sysext/scheduler/Classes/Command/SchedulerCommand.php(190): TYPO3\CMS\Scheduler\Command\SchedulerCommand->executeOrStopTask(Object(Aimeos\Aimeos\Scheduler\Task\Email6))
#10 /html/composer-installation/public/typo3/sysext/scheduler/Classes/Command/SchedulerCommand.php(119): TYPO3\CMS\Scheduler\Command\SchedulerCommand->loopTasks()
#11 /html/composer-installation/vendor/symfony/console/Command/Command.php(298): TYPO3\CMS\Scheduler\Command\SchedulerCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /html/composer-installation/vendor/symfony/console/Application.php(1005): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /html/composer-installation/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand(Object(TYPO3\CMS\Scheduler\Command\SchedulerCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /html/composer-installation/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /html/composer-installation/public/typo3/sysext/core/Classes/Console/CommandApplication.php(91): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /html/composer-installation/public/typo3/sysext/core/bin/typo3(23): TYPO3\CMS\Core\Console\CommandApplication->run()
#17 /html/composer-installation/public/typo3/sysext/core/bin/typo3(24): closure()
#18 main

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

Re: Subscription dateInterval error

Post by aimeos » 30 Dec 2021, 10:16

There was a bug when saving the date/time intervals with hours. Instead of "P1H", it must be "PT1H" we've fixed this in dev-master and 2021.10.x-dev. You can update your installation by executing:

Code: Select all

composer req aimeos/ai-admin-jqadm:2021.10.x-dev
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

hansklatt
Posts: 20
Joined: 29 Jul 2021, 20:19

Re: Subscription dateInterval error

Post by hansklatt » 03 Jan 2022, 16:47

Thank you for your answer,

i updated my system to aimeos version 21.10.dev

when i want to order a product with an one hour interval the system show this error:

Invalid time interval format "PT01H"

i test the subscription with 1 day interval.

The system dont save intervals with only hours.

I installed this aimeos packages with php-composer:

"aimeos/ai-admin-jqadm": "2021.10.x-dev",
"aimeos/ai-admin-jsonadm": "2021.10.x-dev",
"aimeos/ai-client-html": "2021.10.x-dev",
"aimeos/ai-client-jsonapi": "2021.10.x-dev",
"aimeos/ai-gettext": "2021.10.x-dev",
"aimeos/ai-typo3": "2021.10.x-dev",
"aimeos/aimeos-core": "2021.10.x-dev",
"nyholm/psr7": "1.2",
"nyholm/psr7-server": "1.0",
"aimeos/ai-controller-frontend": "2021.10.x-dev",
"aimeos/ai-controller-jobs": "2021.10.x-dev",
"aimeos/ai-payments": "2021.10.x-dev",
"aimeoscom/ai-vatcheck": "2021.10.x-dev",
"omnipay/paypal": "^3.0",
"aimeos/aimeos-typo3": "2021.10.x-dev",


Do you know anything what can i do to fix the subscription-function for an hour time interval?

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

Re: Subscription dateInterval error

Post by aimeos » 04 Jan 2022, 08:18

The hour problem was a problem displaying the value and the intervals are now saved correctly even if you enter "01". To update you installation, run

Code: Select all

composer up
You have to fix the wrong date/time intervals that have been created up to now in the "Attribute" panel (or delete them and recreate them if you are not sure about the format).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

hansklatt
Posts: 20
Joined: 29 Jul 2021, 20:19

Re: Subscription dateInterval error

Post by hansklatt » 04 Jan 2022, 08:43

Thank you for your answer,
i updated the composer-Installation, and i enter only "1" for Time-Interval.
The system saves my one hour interval configuration after your "composer up" answer correctly, but
I cant pay my Order because the error "Invalid time interval format "PT1H" comes.

hansklatt
Posts: 20
Joined: 29 Jul 2021, 20:19

Re: Subscription dateInterval error

Post by hansklatt » 04 Jan 2022, 10:14

Hello dear Aimeos team,
I may have figured out why I have these problems with the hourly interval.

I took a closer look at the Aimeos core and noticed that in the following path:
https://github.com/aimeos/aimeos-core/b ... d.php#L165, the query for the subscription code takes place.

In the hours is the prefix PT instead of P, after I have manually supplemented with a T the hourly subscription works where then the daily subscription does not work.

Is it possible I’m wrong about this or is that a bug?

I realize that you should never edit anything on the core, I only noticed that when finding a solution.

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

Re: Subscription dateInterval error

Post by aimeos » 04 Jan 2022, 10:35

Thanks for spotting the problem!
The code has now been changed to allow date/time intervals including the "T" modifier. Run "composer up" to get the latest version.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

hansklatt
Posts: 20
Joined: 29 Jul 2021, 20:19

Re: Subscription dateInterval error

Post by hansklatt » 04 Jan 2022, 14:56

You’re welcome.
Thank you for responding so quickly!

Post Reply