Review main Merged

32778[TASK] Use FLUIDTEMPLATE for rendering module Configuration

Frank Nägler CR +2 V +2 Normal +98 −45 updated 09/20/14, 21:27

Commit message

As cleanup and improvement for the backend it is important to remove the
HTML code from the PHP logic. This patch removes the HTML code and uses
StandaloneView to render the content of the module.

The markup was removed as far as possible.

Review

  • Code review CR +2
    • Markus Klein +2
    • Tymoteusz Motylewski +1
  • Verified V +2
    • Markus Klein +2
    • Tymoteusz Motylewski +1

Issues 1

Files 3

Review log 28

Show 3 earlier messages
  1. Frank Nägler uploaded patch set 1 09/15/14, 12:21

  2. Frank Nägler uploaded patch set 2 09/15/14, 12:24

  3. Wouter Wolters commented on patch set 2 09/15/14, 21:00

    ConfigurationView.php:30

    do we really need to have this variable?

    ConfigurationView.php:35

    I'd rather call this $view. In normal extbase extension this is also called $this->view

    ConfigurationView.php:44

    no need to inject here, just use: /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */ $flashMessageService = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');

    ConfigurationView.php:151

    GeneralUtility::getFileAbsFileName('EXT:lowlevel/Resources/Private/Templates/Backend/Configuration.html'

    ConfigurationView.php:284

    Boolean values need to be uppercase, so this is valid: TRUE, FALSE or NULL

    ConfigurationView.php:345

    create an instance here for the flashMessageService.

    Configuration.html:13

    use tabs instead of spaces in this file

    index.php:24

    IMO this is wrong and no injection is needed. Explained in other file
  1. Frank Nägler commented on patch set 2 09/15/14, 21:22

    thx for your review, I will send a new patchset later or tomorrow.

    index.php:24 Reply

    this change was necessary, else the @inject would not work. but if I remove the @inject then I can revert this change.
  2. Felix Kopp commented on patch set 2 V -1 09/15/14, 21:50

    One more thing: Seems like the Fun-Menu content labels are broken

    ConfigurationView.php:291

    Do we need DocumenTemplate anymore? I think it is a good step to render content by Fluid into DocumentTemplate but the second step should be planned already: Deliver Layout/default.html and render docHeaderButtons as Backend menu ViewHelper. A FuncMenu ViewHelper would be great also since that is needed in many places.
  3. Felix Kopp commented on patch set 2 09/15/14, 21:51

    Frank. Great work! We should use your approach as a best practice info for piBase - Fluid migration for other extensions also when it is complete! Thanks!
  4. Frank Nägler uploaded patch set 3 09/15/14, 22:22

  5. Frank Nägler commented on patch set 3 09/15/14, 22:24

    thx for all your feedback, here is a new patchset. I removed $GLOBALS['LANG']->getLL() and replaced it with LocalizationUtility::translate() one step more near to a new code structure. All hints and wishes from Wouter also included in the new patchset
  6. Felix Kopp commented on patch set 3 V +1 09/16/14, 22:35

    Seems to work okay! Form remembers values. Off-topic: I get a strange error with TYPO3\CMS\Lowlevel\Utility\ArrayBrowser only with text value and RegExp option. That error exists with and without this patch.

    ConfigurationView.php:28

    view:) remove the var name

    ConfigurationView.php:285

    Note: This line brings the <form> tag

    Configuration.html:25

    divider/spacer not needed any more - spaces should be created by t3skin itself
  7. Stefan Neufeind commented on patch set 3 09/16/14, 23:10

    About using static calls for the translations: Didn't we want to avoid static calls for various reasons (testing, overloading/replacing, ...) where possible? But besides that many thanks for separating core and template here!
  8. Frank Nägler commented on patch set 3 09/17/14, 07:30

    @Stefan: $GLOBALS['LANG']->getLL() is also ugly, but have you an idea how to get the labels without $GLOBALS['LANG']->getLL() or LocalizationUtility::translate() ? The idea is to bring the BE more and more in a new and modern direction. The best is to rewrite alle BE modules with extbase/fluid, but this is a really big task. I would like to see no translations in the controller, this should all be done with a view helper, but in this cleanup step it is not possible to do it.
  9. Markus Klein commented on patch set 3 09/17/14, 07:49

    IMHO static calls are ok, but we shouldn't introduce new static methods. For testing, you could of course move these calls to a separate function, so it can be mocked in tests.
  10. Markus Klein updated the commit message in patch set 4 09/17/14, 08:42

  11. Markus Klein commented on patch set 4 09/17/14, 08:47

    ConfigurationView.php:267

    maybe keep the trim() for $line

    ConfigurationView.php:329

    api??

    ConfigurationView.php:331

    public?
  12. Markus Klein commented on patch set 4 09/17/14, 08:50

    Configuration.html:3

    you can avoid these attributes if you initialize the standaloneview correctly. $view->getRequest()->setControllerExtensionName('lowlevel');

    Configuration.html:25

    why that? Just add the style to the div below
  13. Wouter Wolters commented on patch set 4 09/17/14, 08:56

    ConfigurationView.php:28

    remove $template
  14. Frank Nägler uploaded patch set 5 09/17/14, 09:13

  15. Frank Nägler commented on patch set 4 09/17/14, 09:13

    ConfigurationView.php:28 Reply

    Done

    ConfigurationView.php:267 Reply

    Done

    ConfigurationView.php:329 Reply

    Done

    ConfigurationView.php:331 Reply

    Done

    Configuration.html:3 Reply

    Done

    Configuration.html:25 Reply

    was a spacer in the old view, you are right, this can be moved into another div.
  16. Frank Nägler uploaded patch set 6 09/17/14, 09:52

  17. Frank Nägler commented on patch set 6 09/17/14, 09:53

    correct commit message
  18. Markus Klein updated the commit message in patch set 7 09/17/14, 10:07

  19. Markus Klein commented on patch set 7 CR -1 09/17/14, 10:22

    Configuration.html:29

    should only be shown if line has content
  20. Frank Nägler uploaded patch set 8 09/17/14, 17:38

  21. Frank Nägler commented on patch set 8 09/17/14, 17:39

    fixed the display of variable field and save button
  22. Markus Klein voted on patch set 8 CR +1 V +1 09/17/14, 18:39

  23. Tymoteusz Motylewski voted on patch set 8 CR +1 V +1 09/20/14, 09:10

  24. Markus Klein voted on patch set 8 CR +2 V +2 09/20/14, 21:27

  25. Markus Klein merged patch set 8 09/20/14, 21:27