Make inline TCA fields workspace-transparent for Extbase (foreign_field and foreign_sortby)
In TYPO3 9.5 workspaces still don't work transparently in Frontend (Extbase) for the standard-usecase of inline records.
I feel this is very annoying, and I can't understand why it works in the backend (foreign_field and foreign_sortby), but can't be implemented properly for Extbase!
In my humble opinion the correct method to get the records for an inline-field would be this (only if we are not in live-workspace):
- fetch all live records without workspace-overlay by foreign_field (or mm-relation)
- fetch all workspace-overlay-records by foreign field (or mm-relation)
- fetch the original live records of the workspace-overlay-records and do the overlay
- sort the records with usort by foreign_sortby
Of course this only works if the getter for the foreign_sortby - field is there in the model. Ok, it's maybe expensive to sort the records in PHP context, but 1. this only happens in draft Workspace and 2. this behaviour could be switched on or off with a annotation in the model! And it's something that SHOULD work out of the box!
Any opinions or thoughts to this?