aimeos / aimeos-typo3

TYPO3 e-commerce extension for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce

Home Page:https://aimeos.org/TYPO3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scheduler not working (Undefined array key)

noaluzzi opened this issue · comments

Typo3 v11.5.15, Aimeos 22.7.1
If I want to add a new Scheduler Task, the following errors appear:
PHP Warning: Undefined array key "aimeos_controller" in /var/www/html/public/typo3conf/ext/aimeos/Classes/Scheduler/Provider/AbstractProvider.php line 55 PHP Warning: Undefined array key "aimeos_sender_from" in /var/www/html/public/typo3conf/ext/aimeos/Classes/Scheduler/Provider/Email.php line 61

Seems to be an error somehow connected to the getFields() function in all of the files in the /ext/aimeos/Classes/Scheduler/ directory.

Seems like you haven't filled in the sender e-mail address

Thank you for the fast answer. Sorry I didn't explain it enough: The field for the sender address isn't being generated for it ot be filled. None of the aimeos related fields are being rendered in the backend for them to fill. That's why I suppose something not working aîn the getFields() function.

Yes, that's the root cause. Can you check if there are any errors in the log that may cause the problem?

The Log is giving me the following error:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: Call to undefined method Aimeos\Aimeos\Scheduler\Provider\Email6::getFields() | Error thrown in file /var/www/html/public/typo3conf/ext/aimeos/Classes/Scheduler/Provider/Email6.php in line 40. Requested URL: http://www.localhost/typo3/module/system/txschedulerM1?token=--AnonymizedToken--&SET%5Bfunction%5D=scheduler&CMD=add&tx_scheduler%5Bclass%5D=Aimeos%5CAimeos%5CScheduler%5CTask%5CEmail6

The method is inherited from the Email class:
https://github.com/aimeos/aimeos-typo3/blob/master/Classes/Scheduler/Provider/Email6.php#L19
https://github.com/aimeos/aimeos-typo3/blob/master/Classes/Scheduler/Provider/Email.php#L51

Which PHP Version are you using? PHP 8.0 till 8.0.10 are buggy and caused such problems.

The application is running on PHP 8.1.9.

We are running the same version without problems but it's a bug in the PHP interpreter nevertheless.
For testing, you can try to switch off the PHP OPCache and see if it works afterwards.

I switched off PHP OPCache and the errors remain. Tried re-installing the whole application twice without any success.

Because it's an error in the PHP interpreter, re-installing the application won't help.

Now I inserted the Task using SQL directly into the database. The Task works as intended, but can't be edited because of discussed error.

So the same error occurs on:

  • Local installation on Docker, PHP 8.1.9
  • Server installation, PHP 8.1.9

I got rid of all errors and the scheduler works perfectly fine by replacing all (for each field):
$taskInfo[$this->fieldController] = (array) $taskInfo[$this->fieldController];
with (for each field):
(isset($taskInfo[$this->fieldController]) ? (array) $taskInfo[$this->fieldController] : $taskInfo[$this->fieldController] = []);
in the files aimeos/Classes/Scheduler/Provider/AbstractProvider.php and aimeos/Classes/Scheduler/Provider/Email.php

Unfortunately, these fields are not optional and you need them for selecting which site and job controller should be used (as well as additional configuration). The underlying problem in your setup is that the fields are not rendered and this must be fixed instead.

We've made several tests now with the same PHP version (8.1.9), same TYPO3 version (11.5.15) and same Aimeos version (22.7.1) but we were unable to reproduce the problem. It might be a strange PHP bug which only occurs rarely but such things are hard to track and even harder to fix. We also can't make the fields optional because they are required. Sorry, but we don't have a solution yet for your problem :-(

Thank you for trying to help! My workaround works just fine for my project :)

We leave the issue open, if others face the same problem. Then, maybe we can get closer to get a solution.

Finally, we've applied your workaround because it's the best option so solve the problem. The changes are included in 22.10.1+