Review main Merged

83638[FEATURE] Group-based content fetching in Frontend

Benni Mack CR +2 V +2 Hard +473 −1 updated 05/24/24, 12:14

Commit message

This change adds a new RecordCollector which is similar
to CONTENT cObject, except that it does not render the records
directly, but instead creates instances of a generic Record
object, so the Templating Engine can deal with the way of
how the record should be rendered.

Based on the Page Layout / Backend Layout, all registered
colPos contents are fetched, and grouped, if the Backend Layout
has an "identifier" set via a new PageContentFetchingProcessor
("page-content").

The slide functionality can now be defined in the Page Layout as well
(Backend Layout), with a Enum defining to Collect, CollectReverse
and a simple Slide logic.

This feature brings a clearer separation of fetching
content from the database and the actual representation
in the output (fluid) in place, allowing for further
optimizations.

In addition, one needs to write much less TypoScript
to fetch all contents from a page.

Next steps is then to enrich the records with their
relations (see next feature), and to optimize the Fluid-based
rendering for any kind of content.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Oli Bartsch +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Oli Bartsch +1
    • core-ci +1 CI

Issues 1

Files 14

Review log 3451

Show 1826 earlier messages
  1. Benni Mack uploaded patch set 1 04/02/24, 12:26

  2. core-ci voted on patch set 1 V -1 04/02/24, 12:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55163

  3. Nikita Hovratov commented on patch set 1 04/02/24, 19:13

    RecordFactory.php:139

    I guess this is taken from the stale TcaSchema patch, right? Do you think we should first introduce TcaSchema and then use it here, or refactor it later? Exactly this code will be needed later for the native RelationResolver, too.
  4. Benni Mack commented on patch set 1 04/02/24, 19:36

    RecordFactory.php:139 Reply

    yes, I thought about adding TcaSchema first, but this has / had too many open questions for me and too much code to get started. I'd rather remove it later-on from this place, and replace it with TcaSchema. In addition, I think we should have a RecordInterface, and having a "RawRecord" with just the raw properties, then a Record object (which decorates the RawRecord) and then we can have a ResolvedRecord - wdyt? This way, we can add the RelationResolver in a separate / followup patch. Some further remarks from Benji today: - get rid of the wither method - remove the ContentFetchingProcessor - consider a better name for the PageContentFetchingProcessor - add tests for slide mode Further notes from me: Use lower-cased full type "content.textpic". where the "content" part would come from a TCA[tt_content][ctrl][blockType] = "content", and the rest from the type field.
  5. Nikita Hovratov commented on patch set 1 04/02/24, 19:56

    RecordFactory.php:139 Reply

    Ok, we can later streamline this. Content Blocks will need the same treatment. I like the idea of decorated raw records, in fact this is exactly what I am doing in Content Blocks. It will be later necessary to have nested "ResolvedRecords/ResolvedRelations". So the `properties" or maybe later `resolvedProperties` can have one or an array of "ResolvedRecords" themselves. We need to think about this well, before making it public API. I would suggest to make it internal (RecordFactory) until we have figured all things out. > Use lower-cased full type "content.textpic". where the "content" part would come > from a TCA[tt_content][ctrl][blockType] = "content", and the rest from the type field. So this should be like a unique identifier for the record type? This would need validation somehow, so no two TCA definitions have the same `blockType`. The table name is unique, though. Maybe we should just use it instead?
  6. Oliver Hader commented on patch set 1 04/03/24, 09:38

    Record.php:96

    Comparing this with other frameworks like Polymer or VueJS, I think it would be good to explicitly separate (user-submitted) properties from internal/computed data, thus e.g. * `props` for the current `properties` * `data` or `meta` for anything that is generated or context specific This would resolve ambiguity for those special names - and e.g. allowing to use `language` as property in the `Record` concept.

    Record.php:113

    Pattern type of this class? immutable like done in `withRawProperties()` or mutable for array-access → alternatively deny `offsetSet` und `offsetUnset` but use dedicated `withPropertyValue(string $name, mixed $value): self` and `withUnsetProperty(string $name): self

    RecordFactory.php:25

    `@internal` probably for the time being

    RecordFactory.php:139 Reply

    For security concerns it lacks somehow the context the record is supposed to be used/published - for instance, `be_users.password` should not accidentally be exposed to the frontend. But okay to refine that later...
  7. Benni Mack uploaded patch set 2 V -1 04/03/24, 10:19

  8. core-ci voted on patch set 2 V -1 04/03/24, 10:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55260

  9. Benni Mack uploaded patch set 3 V -1 04/08/24, 13:42

  10. core-ci voted on patch set 3 V -1 04/08/24, 13:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55565

  11. Benni Mack uploaded patch set 4 V -1 04/08/24, 14:57

  12. core-ci voted on patch set 4 V -1 04/08/24, 15:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55570

  13. Benni Mack uploaded patch set 5 V -1 04/09/24, 11:38

  14. Benni Mack commented on patch set 5 04/09/24, 11:38

    Record.php:113 Reply

    Done

    RecordFactory.php:25 Reply

    Done
  15. Christian Kuhn commented on patch set 5 04/09/24, 11:42

    RecordCollector.php:58

    does this collide with the strategy to resolve relations at a central point exactly once using refindex?
  16. core-ci voted on patch set 5 V -1 04/09/24, 11:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55600

  17. Benni Mack commented on patch set 5 04/09/24, 14:39

    RecordCollector.php:58 Reply

    I do have this in mind / in the back of my head. Right now, this is all properly encapsulated in internal structure, so it does not really matter how we resolve this later-on (e.g. switching to one DB query), however we would need to consider how to deal with the different slide options available (maybe fetch all of them once, order by colPos and pid and then group them in PHP then). Doing this in the code could be even possible right now, I can try to do this right away.
  18. Benni Mack uploaded patch set 6 V -1 04/09/24, 17:24

  19. Benni Mack uploaded patch set 7 04/09/24, 17:25

  20. core-ci voted on patch set 7 V -1 04/09/24, 17:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55624

  21. core-ci voted on patch set 6 V -1 04/09/24, 17:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55622

  22. André Buchmann commented on patch set 7 04/10/24, 17:57

    References (Files, Inline Elements,...) should be resolved recursively
  23. Nikita Hovratov commented on patch set 7 04/13/24, 12:25

    Reply

    The (recursive) resolving will be continued in this patch: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83725
  24. Benni Mack uploaded patch set 8 V -1 05/14/24, 18:55

  25. core-ci voted on patch set 8 V -1 05/14/24, 18:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57726

  26. Benni Mack uploaded patch set 9 V -1 05/14/24, 19:07

  1. core-ci voted on patch set 9 V -1 05/14/24, 19:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57727

  2. André Buchmann commented on patch set 9 05/17/24, 05:59

    PageContentFetchingProcessor.php:57

    There is no identifier in the BackendLayoutView::getDefaultColumnLayout() configuration. Therefor forcing the integrator to create a BackendLayout and assign it to the pages.
  3. André Buchmann uploaded patch set 10 V -1 05/17/24, 08:05

  4. core-ci voted on patch set 10 V -1 05/17/24, 08:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57855

  5. André Buchmann uploaded patch set 11 V -1 05/17/24, 11:45

  6. core-ci voted on patch set 11 V -1 05/17/24, 11:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57864

  7. Benni Mack commented on patch set 11 05/17/24, 15:03

    PageContentFetchingProcessor.php:57 Reply

    I think it'd be good to add them there.

    PageContentFetchingProcessor.php:57 Reply

    I think it'd be good to add them there.
  8. Benni Mack uploaded patch set 12 V -1 05/23/24, 21:45

  9. Benni Mack commented on patch set 12 05/23/24, 21:47

    Record.php:96 Reply

    Done
  10. core-ci voted on patch set 12 V -1 05/23/24, 21:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58113

  11. Benni Mack uploaded patch set 13 V -1 05/23/24, 22:25

  12. core-ci voted on patch set 13 V -1 05/23/24, 22:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58114

  13. Benni Mack uploaded patch set 14 V -1 05/23/24, 22:36

  14. core-ci voted on patch set 14 V +1 05/23/24, 22:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58115

  15. Benni Mack uploaded patch set 15 V +1 05/24/24, 10:15

  16. Benni Mack commented on patch set 15 05/24/24, 10:16

    RecordCollector.php:58 Reply

    I left out the relations for the time being
  17. Benni Mack updated the commit message in patch set 16 05/24/24, 10:17

  18. core-ci voted on patch set 16 V -1 05/24/24, 10:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58147

  19. core-ci voted on patch set 15 V +1 05/24/24, 10:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58146

  20. Georg Ringer commented on patch set 17 V -1 05/24/24, 10:29

    Published edit on patch set 16.
  21. Georg Ringer voted on patch set 17 CR +1 V +1 05/24/24, 10:31

  22. core-ci voted on patch set 17 V +1 05/24/24, 10:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58148

  23. Oli Bartsch voted on patch set 17 CR +1 V +1 05/24/24, 11:52

  24. Benni Mack commented on patch set 17 CR +2 V +2 05/24/24, 12:14

    Thanks for the votes!
  25. Benni Mack merged patch set 18 05/24/24, 12:14