Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
82287[FEATURE] Introduce preview rendering for plugins
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 32
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/87/82287/32 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/87/82287/32 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V -1 Blocked
- core-ci -1 CI
Issues 1
Files 16
- typo3/sysext/backend/Classes/Preview/Event/FlexFormPreviewPostProcessingEvent.phpnew+43 −0
- typo3/sysext/backend/Classes/Preview/Event/FlexFormPreviewPreProcessingEvent.phpnew+46 −0
- typo3/sysext/backend/Classes/Preview/Event/ProcessUnknownFieldTypeEvent.phpnew+56 −0
- typo3/sysext/backend/Classes/Preview/Event/RenderUnknownFieldTypeEvent.phpnew+69 −0
- typo3/sysext/backend/Classes/Preview/FlexFormPreviewGenerator.php12new+159 −0
- typo3/sysext/backend/Classes/Preview/SchemaPreviewProcessor.php9new+342 −0
- typo3/sysext/backend/Classes/Preview/SchemaPreviewRenderer.phpnew+533 −0
- typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php3+5 −0
- typo3/sysext/backend/Classes/Utility/BackendUtility.php3+2 −1
- typo3/sysext/backend/Resources/Private/Language/locallang_layout.xlf+6 −0
- typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/test_plugin_preview/Configuration/FlexForms/Fields.xmlnew+338 −0
- typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/test_plugin_preview/Configuration/TCA/Overrides/tt_content.phpnew+27 −0
- typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/test_plugin_preview/composer.jsonnew+14 −0
- typo3/sysext/backend/Tests/Functional/Preview/Fixtures/flexform_content.csvnew+86 −0
- typo3/sysext/backend/Tests/Functional/Preview/FlexFormPreviewGeneratorTest.phpnew+349 −0
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-102685-AddPreviewRendererForContentElementsWithFlexFormSheets.rstnew+100 −0
Review log 6397
Show 4572 earlier messages
-
Torben Hansen uploaded patch set 1 12/30/23, 06:24
-
core-ci voted on patch set 1 V +1 12/30/23, 06:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51007
-
Simon Schaufelberger uploaded patch set 2
V +112/30/23, 11:33 -
core-ci voted on patch set 2 V +1 12/30/23, 11:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51010
-
Simon Schaufelberger uploaded patch set 3
V +112/30/23, 11:41 -
core-ci voted on patch set 3 V +1 12/30/23, 11:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51011
-
Simon Schaufelberger uploaded patch set 4
V +112/30/23, 12:49 -
core-ci voted on patch set 4 V +1 12/30/23, 12:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51013
-
Simon Schaufelberger uploaded patch set 5
V +112/30/23, 13:04 -
Simon Schaufelberger voted on patch set 5 CR +1 V +1 12/30/23, 13:06
-
Simon Schaufelberger uploaded patch set 6
CR +1V +112/30/23, 13:09 -
Simon Schaufelberger voted on patch set 6 CR +1 V +1 12/30/23, 13:10
-
core-ci voted on patch set 5 V -1 12/30/23, 13:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51014
-
core-ci voted on patch set 6 V -1 12/30/23, 13:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51015
-
Simon Schaufelberger uploaded patch set 7
CR +1V +112/30/23, 13:53 -
Simon Schaufelberger voted on patch set 7 CR +1 V +1 12/30/23, 13:53
-
core-ci voted on patch set 7 V +1 12/30/23, 13:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51017
-
Christian Kuhn commented on patch set 7 12/30/23, 15:00
i think benni should have a look here since he has various ideas on 'be plugin preview' things. -
Chris Müller uploaded patch set 8
CR +1V +101/30/24, 19:06 -
core-ci voted on patch set 8 V +1 01/30/24, 19:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52514
-
Benni Mack commented on patch set 8 CR -1 02/10/24, 21:46
This change introduces two abstract classes, so we have an interface + three inheritance levels (for a regular plugin). I do think we should avoid inheritance and find better ways via composition instead - what do you think? -
Benni Mack commented on patch set 8 02/10/24, 21:47
plus, both abstract classes do not have an abstract method in there -
Simon Schaufelberger commented on patch set 8 04/03/24, 23:25
Reply
@derhansen@gmail.com ping. I would welcome this patch very much but it still needs some love -
Torben Hansen commented on patch set 8 04/04/24, 05:47
Reply
@simonschaufi+typo3@gmail.com I talked with Benni about the patch on the community sprint in march and he has some more plans. I'm pretty confident we can get the remaining work done before the feature freeze. -
Nikita Hovratov commented on patch set 8 04/04/24, 20:02
AbstractPluginPreviewRenderer.php:34I'd like to see this as a standalone feature. Something like "FlexFormRelationResolver". This could then also be used in the frontend and replace things like "FlexFormProcessor". Btw, this is a feature still missing in Content Blocks, so it would work great together. -
Torben Hansen uploaded patch set 9
CR -1V +109/13/24, 09:48 -
core-ci voted on patch set 9 V -1 09/13/24, 09:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65651
-
Torben Hansen commented on patch set 9 09/13/24, 11:52
Reply
DoneAbstractPluginPreviewRenderer.php:34ReplyPatch now uses RecordFactory and TCA schema to resolve field configuration and field values. All flexform related preview rendering has been moved to a dedicated service. Patch is however still WIP and POC -
Torben Hansen uploaded patch set 10
V -109/13/24, 14:06 -
core-ci voted on patch set 10 V -1 09/13/24, 14:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65687
-
Torben Hansen uploaded patch set 11
V -109/13/24, 17:52 -
core-ci voted on patch set 11 V +1 09/13/24, 17:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65703
-
Torben Hansen uploaded patch set 12
V +109/14/24, 12:38 -
core-ci voted on patch set 12 V +1 09/14/24, 12:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65758
-
Torben Hansen updated the commit message in patch set 13
V +109/23/24, 16:37 -
core-ci voted on patch set 13 V +1 09/23/24, 16:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66450
-
Torben Hansen rebased onto patch set 14
V +110/02/24, 16:43 -
core-ci voted on patch set 14 V +1 10/02/24, 16:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66984
-
Benni Mack marked it work in progress 03/22/25, 13:16
-
Michael Binder uploaded patch set 15
V +110/30/25, 16:03 -
core-ci voted on patch set 15 V -1 10/30/25, 16:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88164
-
Benni Mack uploaded patch set 16
V -101/22/26, 20:14 -
core-ci voted on patch set 16 V -1 01/22/26, 20:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94099
-
Benni Mack uploaded patch set 17
V -102/01/26, 13:39 -
core-ci voted on patch set 17 V -1 02/01/26, 14:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94763
-
Oliver Hader commented on patch set 17 02/02/26, 12:19
FlexFormPreviewGenerator.php:76Maybe call this event like `*PreProcessingEvent` or `*BeforeEvent`, and add `GridColumnItem $item` to the event propertiesFlexFormPreviewGenerator.php:131e.g. `~PostProcessingEvent`, or `~AfterEvent` (incl. `$item` and `$previewRows`) -
Simon Schaufelberger commented on patch set 17 02/02/26, 16:18
FlexFormPreviewGenerator.php:76ReplyDoneFlexFormPreviewGenerator.php:131ReplyDone -
Simon Schaufelberger uploaded patch set 18
V -102/03/26, 11:11 -
Simon Schaufelberger uploaded patch set 19 02/03/26, 11:13
-
core-ci voted on patch set 18 V -1 02/03/26, 11:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94892
-
Oli Bartsch commented on patch set 19 02/03/26, 11:17
This change is ready for review. -
core-ci voted on patch set 19 V +1 02/03/26, 11:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94893
-
Oliver Hader commented on patch set 19 02/03/26, 14:36
FlexFormPreviewGenerator.php:53I guess singleton can be dropped hereFlexFormPreviewGenerator.php:96What if `fieldNameWithoutSheet` is empty?FlexFormPreviewGenerator.php:115I think having (or using) a central component here, that is capable of providing "human readable" representations of of there values would be nice. For instance `\TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue` is performing similar processings already. For cases here, e.g. `datetime` does not seem to support its persistence types for having a human readable data representation. -
Simon Schaufelberger commented on patch set 19 02/04/26, 22:14
FlexFormPreviewGenerator.php:53ReplyDoneFlexFormPreviewGenerator.php:96Replythis can never happen. Either we have a field in the sheet or there are no fields, then I don't enter the loop. the `??` can actually be removed. -
Simon Schaufelberger uploaded patch set 20
V +102/11/26, 23:07 -
core-ci voted on patch set 20 V -1 02/11/26, 23:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95662
-
Simon Schaufelberger uploaded patch set 21
V -102/13/26, 23:18 -
core-ci voted on patch set 21 V +1 02/13/26, 23:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95853
-
Simon Schaufelberger uploaded patch set 22
V +102/20/26, 22:33 -
core-ci voted on patch set 22 V +1 02/20/26, 22:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96416
-
Benni Mack commented on patch set 22 02/23/26, 11:49
FlexFormPreviewGenerator.php:115Reply@simonschaufi+typo3@gmail.com I think so as well: let's make the whole generator smaller, but actually implement this in getProcessedValue() instead directly. -
Simon Schaufelberger rebased onto patch set 23
V +103/19/26, 22:25 -
Simon Schaufelberger commented on patch set 23 03/19/26, 22:35
FlexFormPreviewGenerator.php:115Reply@benni@typo3.org @bo@cedev.de The backend already provides a FlexFormValueFormatter which is used in the ElementHistoryController for a preview of the FlexForm values that changed. The thing is that this is only plain text and the rendering it not reusable. Secondly, many fields are only rendered as comma separated values or internal identifiers that are not very userfriendly and helpful. Since the FlexFormValueFormatter is internally using the `BackendUtility::getProcessedValue`, the rendering is not the best. That is why I decided (on the last code sprint) to implement a HTML rendering of many TCA fields that looks good and is easier to understand (for example the actual category names than just the ids). Is there any chance to get this "early" version into the core before the feature freeze and polish it until the LTS release? I would take care of it and would like to get some feedback (the same way with camino and the contextual editing of the page properties) to polish it. -
core-ci voted on patch set 23 V -1 03/19/26, 22:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98249
-
Simon Schaufelberger uploaded patch set 24
V -103/19/26, 22:43 -
core-ci voted on patch set 24 V -1 03/19/26, 22:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98250
-
core-ci commented on patch set 24 03/20/26, 13:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98250
-
core-ci commented on patch set 24 03/20/26, 23:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98250
-
Georg Ringer commented on patch set 24 V -1 03/21/26, 20:43
I see quite some improvements which should be checked before merging it: - previews doesn't uses the full width of space - the full table is linked, not sure if that is a good idea - relations should be shown as relation, maybe even with contxt menu, and selections should be shown different then plain input fields. compare the preview of felogin with e.g. the one of ext:news/tt_address -
Benjamin Franzke commented on patch set 24 03/24/26, 11:50
Feature-102685-AddPreviewRendererForPlugins.rst:14Isn't this actually a (standard) preview renderer for the field `pi_flexform` and not "plugin" in general? I mean, plugins can use or register custom field types, and non plugins may also use `pi_flexform`, that means `pi_flexform !== plugin`, right? -
Simon Schaufelberger uploaded patch set 25
V -103/24/26, 12:06 -
core-ci voted on patch set 25 V -1 03/24/26, 12:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98582
-
Simon Schaufelberger commented on patch set 25 03/24/26, 13:12
Reply
Thank you for the review. - I use 25% for the label column that the distance is not too big until the value column. - Table is not linked anymore - I copied over your code from news for relations. Thank you!Feature-102685-AddPreviewRendererForPlugins.rst:14ReplyThe backend already provides a FlexFormValueFormatter which is used in the ElementHistoryController for a preview of the FlexForm values that changed. The thing is that this is only plain text and the rendering it not reusable. For custom field types there is a new event to render them. The content type (CType) is not relevant. Basically it is a FlexFormPreviewRenderer. -
Simon Schaufelberger uploaded patch set 26
V -103/24/26, 13:22 -
Simon Schaufelberger uploaded patch set 27 03/24/26, 13:34
-
core-ci voted on patch set 26 V -1 03/24/26, 13:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98590
-
Simon Schaufelberger commented on patch set 27 03/24/26, 13:35
FlexFormPreviewGenerator.php:115ReplyDoneFeature-102685-AddPreviewRendererForPlugins.rst:14ReplyI have renamed the file and adjusted the wording. -
core-ci voted on patch set 27 V -1 03/24/26, 13:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98592
-
Simon Schaufelberger uploaded patch set 28
V -103/24/26, 14:19 -
core-ci voted on patch set 28 V +1 03/24/26, 14:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98599
-
Simon Schaufelberger uploaded patch set 29
V +103/24/26, 15:57 -
Garvin Hicking commented on patch set 29 03/24/26, 16:03
SchemaPreviewProcessor.php:46So generally I love the display. But this class IMO does too much and it is a mixed bag of cross cutting concerns. I wonder if we should encapsulate the schema awareness and its representstion inside the actual types, and not in here. To maintain this class in the future is hard. And when someone adds custom types, they have to use decoupled event listeners to provide this, leaving a type-specific domain functionality outside their type class. I think we would be better off in the long run to add something like "gstPreviewValue" inside the types. Then tbis class needs no uodates whenever we create new types, and it would be re-usable outside the preciew function for extbase/fluid operations. The HTML rendering is a bit finnicky to separate, I agree. This is just my feeling. I'm ot blocking this.SchemaPreviewProcessor.php:96Why no DI here?SchemaPreviewProcessor.php:191Use new domain language synrax hereSchemaPreviewProcessor.php:214And hereStandardContentPreviewRenderer.php:258what about tables that use a different field than "pi_flexform" to carry flexforms?BackendUtility.php:1842Could this rather be moved to TCA schema API domain and utilized from there? -
core-ci voted on patch set 29 V -1 03/24/26, 16:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98615
-
Simon Schaufelberger commented on patch set 29 03/24/26, 16:25
SchemaPreviewProcessor.php:96ReplyDoneSchemaPreviewProcessor.php:191ReplyDoneSchemaPreviewProcessor.php:214Replynow the rector rule MigrateLabelReferenceToDomainSyntaxRector is really helpful ;)StandardContentPreviewRenderer.php:258ReplyHmm, I don't know. Is there any way to find this out?BackendUtility.php:1842ReplyFine for me as well. I just don't want to make too much refactoring here. Which class would be suitable for it? -
Simon Schaufelberger uploaded patch set 30
V -103/24/26, 16:34 -
Simon Schaufelberger commented on patch set 30 03/24/26, 16:35
SchemaPreviewProcessor.php:214ReplyDone -
core-ci voted on patch set 30 V +1 03/24/26, 16:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98619
-
Sven Liebert commented on patch set 30 CR +1 V +1 03/24/26, 18:47
Works as described. I have no opinion if thats too much like Garvin described :) -
Georg Ringer voted on patch set 30 CR +1 V +1 03/24/26, 19:13
-
Garvin Hicking commented on patch set 30 03/24/26, 19:34
SchemaPreviewProcessor.php:46Reply UnresolvedSince Simon asked me via DM "please be more specific". This is just my oppinion that the idea itself is great, and while I still would not block this, I think we need to decide if we want to get "a working version" or a "powerful adaptable" version. This depends on the TYPO3 CMS product goals and product strategy, which are not decided by me. The current approach does have its benefits for bundling all that rendering and evluation within two "god" classes, and this bundles maintenance. So I wouldn't say this current approach is "wrong", if I conveyed that impression. So my thoughts: - Basically, this is a more refined variation of BackendUtility::getProcessedValue() - and we could make that one a bit obsolete with the new API I'm describing. It would not be record-based but instead field and field-type based, so it could be used for flexforms (which the current BU:GPV does not) - First the decission could be made where a "resolve TCA type display value by actual value" fits best. - Contestants in my opinion are: - Implementaitons of TYPO3\CMS\Backend\Form\FormDataProviderInterface - Implementations of TYPO3\CMS\Core\Schema\Field\FieldTypeInterface - Implementations of TYPO3\CMS\Backend\Form\Element\AbstractFormElement - IMO FormDataProviders would fit best - I would argue that Record API is a bit similar, but is aimed at actual records, and not flexform dynamic "add-ons". - Then it would probably best to create a new Interface like "PreviewRenderableType" or a PHP Attribute like `#[AsRenderablePreviewType]` - A registry would collect all implementations, a factory service would instantiate the matching implementation, called from the "schema preview processor". - There would be a method like `resolveCurrentValueAsPlaintext` and `resolveCurrentValueAsHTML` - All existing TCA FormDataProvider elements could then utilize this and get their own implemented method - The code calling this method can have a PSR-14 "preProcess" and "postProcess" event, and as before a "NoProcessorFoundEvent"StandardContentPreviewRenderer.php:258Reply UnresolvedYou can use the TCA Schema API to check and collect all fields that are of Type FlexformFieldType. This would need to be done in multiple places of this patch that are currently hard-locked to "pi_flexform".BackendUtility.php:1842ReplySere above; there are several candidates for implementations (based on an abstract), and we could then remove the whole `getProcessedValue` logic at some point. I think in the scope of this patch no better place can be found easily, so I'm resolving this. -
Georg Ringer commented on patch set 30 CR 0 V 0 03/24/26, 22:05
while thinking about I am not so sure if this is something we want to have in the long run to be maintained - the feature freeze must not be a reason to merge stuff early - just to be merged -
Benni Mack wrote 04/21/26, 15:01
Removed reviewer Benni Mack. -
Christian Kuhn wrote 06/18/26, 23:05
Removed cc Christian Kuhn. -
Simon Schaufelberger uploaded patch set 31
CR +1V +106/21/26, 12:09 -
core-ci voted on patch set 31 V -1 06/21/26, 12:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103697
-
Simon Schaufelberger uploaded patch set 32
V -109/08/26, 21:46 -
core-ci voted on patch set 32 V -1 09/08/26, 21:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108125