[BUGFIX] Add `sorting` key to metadata
See #1183
I added the missing entries in MetadataDefaults.php and added a call in addMetadataAction() so that it is saved in the metadata object.
But it is not stored in the DB, where the value for the sorting key is still 0.
Any idea?
According to documentation sorting should be handled by the DataHandler without any need for manually setting values in the database. It should be sufficient to set sortby in the TCA (which we did) and TYPO3 should do the rest. I have no idea why it doesn't work...
Okay, thanks for checking the documentation. Thats really weird than
According to documentation sorting should be handled by the DataHandler without any need for manually setting values in the database. It should be sufficient to set
sortbyin the TCA (which we did) and TYPO3 should do the rest. I have no idea why it doesn't work...
Currently DataHandler is not used to insert metadata. I was writing about it here https://github.com/kitodo/kitodo-presentation/issues/1147#issuecomment-1961467931 :
Extbasedirectly writes to the database, and thus bypassesDataHandler.DataHandleris actually the one which is responsible for the localization of records.
Extbasedirectly writes to the database, and thus bypassesDataHandler.DataHandleris actually the one which is responsible for the localization of records.
But that's by choice, not by design, isn't it? I don't see a reason not to revert to using the DataHandler with Extbase (at least in backend context). The DataHandler is still available in TYPO3 v12. The old implementation (Extbase + DataHandler) can be seen here: https://github.com/kitodo/kitodo-presentation/blob/1ff03fc4c3ab4dfdc0102d5d98837f1e72f57103/Classes/Controller/NewTenantController.php
Oh, I just saw that you already suggested restoring the old method using the DataHandler in #1147... Sorry, I missed that!
But yes, I think that's the way we should proceed!
But yes, I think that's the way we should proceed!
Ok, then I will revert it.
@csidirop As I'm still working on DataHandler usage and can't give the prediction when it will work (basic save works but no localization) ,I have found workaround for sorting problem: https://github.com/beatrycze-volk/kitodo-presentation/commit/6e02b6ec83eaf96f6bc1a7f0dbe6ca2335c2c3dc
It is necessary to add to tx_dlf_metadata.php:
'sorting' => [
'config' => [
'type' => 'passthrough',
],
],
@sebastian-meyer Are you ok with this solution?
It is necessary to add to
tx_dlf_metadata.php:'sorting' => [ 'config' => [ 'type' => 'passthrough', ], ],@sebastian-meyer Are you ok with this solution?
Yes, that's fine! Thank you!
Merging this as a temporary workaround (see #1209).