I have a problem with accessing the crdate
of a fe_user
in a croniob task. I have an extended Frontend user model where I added this adjustments:
https://stackoverflow.com/a/50663006/1684975
Additionaly I've added a mapping via ts
config.tx_extbase {
persistence {
classes {
TYPO3\CMS\Extbase\Domain\Model\FrontendUser {
subclasses {
Tx_MyExt_User = ACV\MyExt\Domain\Model\User
}
}
Paul\MyExt\Domain\Model\User {
mapping {
tableName = fe_users
recordType = Tx_MyExt_User
columns {
crdate.mapOnProperty = crdate
}
}
}
}
}
}
When I fire up the Scheduler task manual via the Scheduler BE module it's ok. But when the real cronjob kicks in I get the error
Uncaught TYPO3 Exception Call to a member function getTimestamp() on null
In the Scheduler task, I get the crDate via the getter and try to get the timestamp…
$users = $frontendRepository->findByOptIn(false);
foreach ($users as $user) {
if ($user->getCrdate()->getTimestamp() < strtotime('-5 days')) {
$frontendRepository->remove($user);
}
}
The mode of the user is correct. I can access other custom properties I've added to the model.
It's TYPO3 v9.5.26.
The odd thing is that it runs locally in my dev environment.
Did someone have an idea what could cause the problem?