Feature #90072

Make inline TCA fields workspace-transparent for Extbase (foreign_field and foreign_sortby)

Added by This Mächler over 2 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2020-01-09
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

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?


Related issues

Related to TYPO3 Core - Bug #81208: Invalid SQL query when previewing a workspace with translated relationsClosedBenni Mack2017-05-12

Actions
Related to TYPO3 Core - Bug #88021: Preview of a record related with FAL does not work when file is changed in a workspaceClosed2019-03-27

Actions
#1

Updated by This Mächler over 2 years ago

To clarify, what does not work properly in draft workspace for inline records:
- re-sorting inline records that have already been pulished to live workspace before
- re-assign inline record to another parent that has already been pulished to live workspace before

The only method to make this work right now would be to fetch ALL potential child records "manually" (in the getter of the model, for ex.), filter them by relation partner and sort them with usort. This only has to be done in draft workspace, so there's no performance loss for live.

It's possible to do this (i think i will write a generic workaround class that handles this), but it SHOULD work out of the box without a hack! And that's not impossible

#2

Updated by Benni Mack almost 2 years ago

  • Related to Bug #81208: Invalid SQL query when previewing a workspace with translated relations added
#3

Updated by Benni Mack about 1 year ago

  • Status changed from New to Needs Feedback

Have a look at this change... https://review.typo3.org/c/Packages/TYPO3.CMS/+/68913 - can you tell me if this solves your problem(s) as well?

#4

Updated by This Mächler about 1 year ago

Sorry for my late answer.
To be honest, I am not able see deep enough in the internal stuff to tell if this will solve my issue fully. It would take me a lot (too much) of time to dig into it.

I had a look at the code change and your description of it. One question arises when I look at it:

does this change also respect the (mm-) related records of the aggregate root which only have a live-record and no overlay (in workspace-mode)? These records should be respected the same way as the versioned ones, and should be included in the sorting ([only-live-foreign-records] + [versioned-foreign-records] ---> sorting).

Hope you get my question.

#5

Updated by Christian Kuhn 4 months ago

  • Related to Bug #88021: Preview of a record related with FAL does not work when file is changed in a workspace added
#6

Updated by Christian Kuhn 4 months ago

  • Status changed from Needs Feedback to Closed

hey. i hope it's ok to close here for now. we had a couple of relation and workspace related fixes in extbase with v11 which improved the situation. in case specific problems still persist, we should restart with a fresh issue that includes good information on how to reproduce.

Also available in: Atom PDF