Reputation: 154
I have frontend controller which can edit record in database. I want to know if there is any way to add information about that changes in typo3 backend history?
I tried to use typo3/cms/typo3/sysext/backend/Classes/History/RecordHistory.php
I checked too how typo3/cms/typo3/sysext/core/Classes/DataHandling/DataHandler.php
set it up but that was over complicated to do in frontend
Thanks for any help!
Upvotes: 0
Views: 341
Reputation: 36
in TYPO3 V10 you can use this extension to make this easy. you just need to implement the interface provided by this extension with your Domain Models to make then trackable by history. https://extensions.typo3.org/extension/fe_data_history/
Upvotes: 2
Reputation: 718
Take a look at Packages/TYPO3.CMS/typo3/sysext/core/Classes/DataHandling/History/RecordHistoryStore.php
:
you can use something similar when you are doing your edit operations.
First, create your own copy of the store as the class is internal and adjust it to your needs, then you can do something like:
$store = GeneralUtility::makeInstance(
RecordHistoryStore::class,
# or USER_FRONTEND depending on your use case
RecordHistoryStore::USER_ANONYMOUS
);
$store->addRecord($table, $uid, $payload);
Upvotes: 1