Issue Bug Rejected

#85318Scheduler tasks: the constructor is never executed

Thomas Heuer 06/20/18, 15:33 updated 03/06/20, 17:21

Description

When defining a scheduler task class by inheriting from \TYPO3\CMS\Scheduler\Task\AbstractTask, an existing constructor does never get executed.

The execute method is not static, but anyway it is called with the class being instantiated in a “normal” way, i.e. executing a constructor.

What to expect:
When I define a constructor in a class inherited from \TYPO3\CMS\Scheduler\Task\AbstractTask it must be executed to allow for variable instantiation.

Example:

class ExampleTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask
{
    public function __construct()
    {
        parent::__construct();

        // This point is never reached, even a debug-breakpoint here would not be respected.
        DebuggerUtility::var_dump($this);
        exit;
    }
}

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.