#88358CLI Scheduler not evaluating extbase overwritten classes
Description
We overwrite couple of classses of pxa_social_feed [1] to extend functionality like so:
config.tx_extbase {
persistence {
classes {
Pixelant\PxaSocialFeed\Domain\Model {
subclasses {
0 = snip\snip\Domain\Model\PxaFeed
}
}
snip\snip\Domain\Model\PxaFeed {
mapping {
tableName = tx_pxasocialfeed_domain_model_feed
# recordType = 0
}
}
}
}
objects {
Pixelant\PxaSocialFeed\Controller\FeedsController.className = snip\snip\Controller\PxaFeedsController
Pixelant\PxaSocialFeed\Domain\Repository\FeedRepository.className = snip\snip\Domain\Repository\PxaFeedRepository
}
}
And we also add a new task for ext:scheduler which is extending the import task of ext:pxa_social_feed [0] (we simply call our taskutlity there and not the original, but keep all the original functionality (like getting the configuration)).
In ImportTaskUtility.php of ext:pxa_social_feed (a php class which is used for ext:scheduler) a new model is either fetched from the database or created for you via objectmanager [2].
This works all well in CGI mode, when you call that scheduler manually. However, in CLI mode the fetched class is of original type (of ext:pxa_social_feed) and not of extended type, and therefore will be ignored to add with exception code 1248363335 .3
As a hotfix I delcared the method ‘saveInstagramFeed’ of ext:pxa_social_feed protected in a fork which allowed me to overwrite it (and ask the objectmanager to fetch my model always). [4]
Is there something I did wrong with extending the classes or does CLI just not care about extbase config?
I’ve only tested this against TYPO3 9.5.5 and 9.5.6, no earlier versions.
[0] https://github.com/pixelant/pxa_social_feed/blob/v1.10.0/Classes/Task/ImportTask.php
1 https://github.com/pixelant/pxa_social_feed
2 https://github.com/pixelant/pxa_social_feed/blob/v1.10.0/Classes/Utility/Task/ImportTaskUtility.php#
3 https://github.com/TYPO3/TYPO3.CMS/blob/v9.5.5/typo3/sysext/extbase/Classes/Persistence/Repository.php#L77
4 https://github.com/pixelant/pxa_social_feed/blob/v1.10.0/Classes/Utility/Task/ImportTaskUtility.php#L418
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.