75178[FEATURE] Revamp TypoScript Template Analyzer
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Stefan Bürk +1
- Andreas Kienast +1
-
Verified V +2 Done
- Christian Kuhn +2
- Stefan Bürk +1
- Andreas Kienast +1
- core-ci +1 CI
Issues 2
Files 22
- Build/Sources/TypeScript/backend/utility/collape-state-persister.tsnew+84 −0
- typo3/sysext/backend/Resources/Public/JavaScript/utility/collape-state-persister.jsnew+13 −0
- typo3/sysext/core/Classes/TypoScript/IncludeTree/IncludeNode/IncludeConditionInterface.php+5 −2
- typo3/sysext/core/Classes/TypoScript/IncludeTree/TreeBuilder.php2+1 −1
- typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php+0 −33
- typo3/sysext/core/Documentation/Changelog/12.0/Feature-97941-ImprovedTypoScriptTemplateAnalyzer.rstnew+33 −0
- typo3/sysext/core/Tests/Functional/TypoScript/IncludeTree/TreeBuilderTest.php+46 −0
- typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerController.php10+207 −196
- typo3/sysext/tstemplate/Classes/TypoScript/IncludeTree/Visitor/IncludeTreeConditionAggregatorVisitor.phpnew+66 −0
- typo3/sysext/tstemplate/Classes/TypoScript/IncludeTree/Visitor/IncludeTreeConditionEnforcerVisitor.phpnew+59 −0
- typo3/sysext/tstemplate/Classes/TypoScript/IncludeTree/Visitor/IncludeTreeSourceAggregatorVisitor.phpnew+99 −0
- typo3/sysext/tstemplate/Classes/ViewHelpers/If/IsInstanceOfViewHelper.php2new+40 −0
- typo3/sysext/tstemplate/Classes/ViewHelpers/FineDiffViewHelper.php2new+46 −0
- typo3/sysext/tstemplate/Classes/ViewHelpers/ForViewHelper.phpnew+53 −0
- typo3/sysext/tstemplate/Configuration/Backend/Modules.php+4 −1
- typo3/sysext/tstemplate/Resources/Private/Language/locallang_analyzer.xlf+44 −14
- typo3/sysext/tstemplate/Resources/Private/Partials/AnalyzerConditions.htmlnew+72 −0
- typo3/sysext/tstemplate/Resources/Private/Partials/AnalyzerOptions.htmlnew+78 −0
- typo3/sysext/tstemplate/Resources/Private/Partials/AnalyzerSource.htmlnew+22 −0
- typo3/sysext/tstemplate/Resources/Private/Partials/AnalyzerTree.html2new+100 −0
Review log 3345
Show 1320 earlier messages
-
Christian Kuhn uploaded patch set 1 07/14/22, 11:47
-
core-ci voted on patch set 1 V +1 07/14/22, 11:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29140
-
Christian Kuhn uploaded patch set 2 07/14/22, 11:58
-
core-ci voted on patch set 2 V +1 07/14/22, 12:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29141
-
Christian Kuhn uploaded patch set 3 07/14/22, 13:33
-
core-ci voted on patch set 3 V +1 07/14/22, 13:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29148
-
Christian Kuhn uploaded patch set 4 07/14/22, 15:23
-
core-ci voted on patch set 4 V +1 07/14/22, 15:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29155
-
Christian Kuhn uploaded patch set 5 07/14/22, 15:40
-
core-ci voted on patch set 5 V +1 07/14/22, 15:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29157
-
Benni Mack commented on patch set 5 V +1 07/14/22, 16:25
Just tested this patch. There are some quirks UI-wise still (collapsable options is a bad idea IMHO), also some "lines" along the inclusions are not 100% complete. In addition, I think we should explain the "Types" of includes and what that means (via tooltip or whatever). Also noticed the quirks around the expanding / collapsing part. However, I'm pretty sure that Benjamin Kott could fix them separately, as they are visual work. -
Oli Bartsch commented on patch set 5 07/14/22, 17:40
Just had a short look because I'm currently not able to access the module. I get the following exception: (1/1) TypeError sha1(): Argument #1 ($string) must be of type string, array given in /var/www/html/typo3/sysext/core/Classes/TypoScript/IncludeTree/TreeBuilder.php line 523 It looks like a setting in my site config triggers this. I define the following there: settings: mySetting: 3TemplateAnalyzerController.php:50Seems to be unused.TemplateAnalyzerController.php:58We might need this line. Seems that it was not called before, due to the if clause which from reading always evaluated to FALSE. However, this might be a bug, because module data is never stored for the user. Will investigate as soon as I'm able to access the module.TemplateAnalyzerController.php:81In case we do no longer use this, we should remove it from the allowed module data.FineDiffViewHelper.php:2I think all those viewhelpers should be marked as @internal.IsInstanceOfViewHelper.php:36I assume there is no other way of handling this in e.g. the controller (or any other class, where business logic takes place)?AnalyzerTreePanel.html:47Could we get rid of those empty tags? According to https://developer.mozilla.org/en-US/docs/Glossary/Empty_element, <td> is not allowed as empty element. -
Stefan Bürk commented on patch set 5 07/14/22, 22:25
Reply
Seems that was a overlook when the new parser/tree build was added. If no "site config settings" are set, there is a early return. This was not tested as it seems. Building the hash should be: ``` $identifier = 'site-constants-' . sha1(serialize($siteSettings)); ``` Should we fix this here along or in a dedicated pre-patch ? -
Christian Kuhn commented on patch set 5 07/15/22, 02:26
Reply
yeah. i actually also didn't manually test TS from sites ;) let me have a look on this, we'll then see if we incorporate in this patch, or have a pre-patch. -
Markus Klein commented on patch set 5 07/15/22, 09:01
AnalyzerTreePanel.html:47ReplyI think you misread the link: Empty elements are defined as: "... cannot have any child nodes" td of course can have children. -
Christian Kuhn commented on patch set 5 07/15/22, 09:06
Reply
Yeah. Unsure about the collapsible 'options'. I went this way since it gives a systematic view of everything and 'boxing' them just looks better than having them standalone on top. They also take quite some space, this will be more obvious with the object browser, later. Imho: keep for now and see if anyone comes up with something better later. It's rather easy to change ... For the types: This is a very straight forward solution currently: The type is just created from the class name. There is a @todo to at least make them translatable. When changing this, we could add more explanation.Reply
bug is rather obvious, actually. thx 4 pointing this out. i wonder why phpstan did not find this: it's an obvious case where an array is fed to sha1(). fixed and added a functional test now.TemplateAnalyzerController.php:50ReplyDone. Good this is gone. ExtendedTemplateService is one of the first targets to fall.TemplateAnalyzerController.php:58Replyi'm currently updating uc when needed explicitly. don't understand full impact here, maybe we could have a quick chat on proper handling?TemplateAnalyzerController.php:81Replylet's have a chat on how to properly handle these things.FineDiffViewHelper.php:2ReplyAckIsInstanceOfViewHelper.php:36Replyyeah. it's used in the recursive tree rendering to omit children if a condition did not match. using the condition interface and testing a tree node for this interface is a straight solution to achieve this. imho fine, at least for now.AnalyzerTreePanel.html:47Replyi think you misinterpreted 'empty element' here. from your link: "An empty element is an element from HTML [...] that cannot have any child nodes". <td> of course *can* have children. it's fine to do that here. -
Christian Kuhn uploaded patch set 6 07/15/22, 09:06
-
core-ci voted on patch set 6 V -1 07/15/22, 09:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29192
-
Christian Kuhn uploaded patch set 7 07/15/22, 09:17
-
core-ci voted on patch set 7 V +1 07/15/22, 09:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29196
-
Christian Kuhn commented on patch set 7 07/15/22, 11:21
TemplateAnalyzerController.php:58ReplyDoneTemplateAnalyzerController.php:81ReplyDone -
Christian Kuhn uploaded patch set 8 07/15/22, 11:21
-
core-ci voted on patch set 8 V +1 07/15/22, 11:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29203
-
Andreas Kienast commented on patch set 8 07/15/22, 11:32
AnalyzerTreePanel.html:22Missing locallang -
Andreas Kienast commented on patch set 8 CR -1 07/15/22, 11:34
on it -
Andreas Kienast uploaded patch set 9 07/15/22, 11:37
-
Andreas Kienast commented on patch set 9 07/15/22, 11:38
Reply
Done -
Andreas Kienast commented on patch set 9 07/15/22, 11:38
AnalyzerTreePanel.html:22ReplyDone -
core-ci voted on patch set 9 V +1 07/15/22, 11:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29205
-
Andreas Kienast commented on patch set 9 07/15/22, 11:47
TemplateAnalyzerController.php:88I wonder whether we should make all the in_array() calls that are also added in other files strict. -
Christian Kuhn commented on patch set 9 07/15/22, 16:49
TemplateAnalyzerController.php:88Replydid that by intention here since getAllTemplateRecordsOnPage() is result of a DB operation which may return the uid as string. -
Simon Schaufelberger commented on patch set 9 07/15/22, 22:13
AnalyzerTree.html:8please use additional html comments inside to make it clear that this is really a commentAnalyzer.html:22same hereAnalyzer.html:41same hereAnalyzer.html:85same here -
Christian Kuhn commented on patch set 9 07/16/22, 10:52
AnalyzerTree.html:8Replyno. f:comment is enough. that't exactly what it is meant for, and it will not output. not reason to have more. that a comment meant to be read by source code readers.Analyzer.html:22Replyno.Analyzer.html:41Replyno.Analyzer.html:85Replyno. -
Andreas Kienast commented on patch set 9 V -1 07/16/22, 13:32
TreeBuilder.php:523implode() fails with "PHP Warning: Array to string conversion" if the settings array is nested. -
Andreas Kienast uploaded patch set 10 07/16/22, 13:33
-
Andreas Kienast commented on patch set 10 07/16/22, 13:34
TreeBuilder.php:523ReplyDone -
Andreas Kienast uploaded patch set 11 07/16/22, 13:36
-
core-ci voted on patch set 10 V +1 07/16/22, 13:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29282
-
core-ci voted on patch set 11 V -1 07/16/22, 13:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29283
-
Andreas Kienast uploaded patch set 12 07/16/22, 13:49
-
core-ci voted on patch set 12 V +1 07/16/22, 13:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29284
-
Andreas Kienast voted on patch set 12 V +1 CR +1 07/16/22, 14:03
-
Stefan Bürk voted on patch set 12 V +1 CR +1 07/16/22, 19:43
-
Christian Kuhn voted on patch set 12 V +2 CR +2 07/16/22, 19:46
-
Christian Kuhn merged patch set 13 07/16/22, 19:46