Review main Merged

73129[TASK] Avoid misusing ModuleTemplate in BackendController

Christian Kuhn CR +2 V +2 Expert +538 −540 updated 01/24/22, 09:38

Commit message

With the deprecation and removal of DocumentTemplate
the backend controllers have been transitioned to use
ModuleTemplate instead.

The ModuleTemplate is primarily designed to take care
of backend modules - just as the name suggests. As such,
it's main concern is to help module controllers
setting up the doc header and rendering the module body.

ModuleTemplate however is currently misused to render
all backend related views: The main frame with
module menu and top bar (BackendController), as well
as backend login related views and a couple of link
popups have nothing to do with doc header. They override
the main ModuleTemplate template and inject their own
ones to ignore doc header and friends.

The reason for that is that ModuleTemplate additionally
configures PageRenderer for backend usage - all the
little details like charset, favicon and similar.

Using ModuleTemplate for main frame an login has the
additional side effect that ModuleTemplate adds a
couple of module related JS files to the PageRenderer.
This leads to the situation that for instance the
login views load DocumentTemplate.js and there is no
good way to get rid of that again.

To further sharpen ModuleTemplate usages and in
preparation of upcoming ModuleTemplate and backend
module related features, this patch starts avoiding
ModuleTemplate usages in those controllers: Affected
controllers feed PageRenderer directly.

To not duplicate the PageRenderer setup code, a trait
is introduced. This trait is core @internal since
extensions shouldn't fiddle on this main level and have
API for specific concerns like login providers already.

The patch adds the trait and refactors the main-frame
BackendController code to use it.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 9

Review log 913

  1. Christian Kuhn uploaded patch set 1 01/22/22, 22:32

  2. Christian Kuhn uploaded patch set 2 01/22/22, 22:35

  3. core-ci voted on patch set 2 V +1 01/22/22, 22:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22419

  4. core-ci voted on patch set 1 V +1 01/22/22, 22:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22418

  5. Christian Kuhn updated the commit message in patch set 3 01/22/22, 22:51

  6. core-ci voted on patch set 3 V +1 01/22/22, 23:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22420

  7. Christian Kuhn commented on patch set 3 CR -1 01/23/22, 12:04

    i'll change a detail so that the trait does not fetch dependencies from elsewhere but receives everything as argument.
  8. Christian Kuhn uploaded patch set 4 01/23/22, 12:08

  9. core-ci voted on patch set 4 V +1 01/23/22, 12:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22430

  10. Benni Mack commented on patch set 4 V +1 CR +1 01/24/22, 07:07

    I think this is a good compromise with the trait.
  11. Stefan Bürk voted on patch set 4 V +1 CR +1 01/24/22, 09:30

  12. Christian Kuhn voted on patch set 4 V +2 CR +2 01/24/22, 09:38

  13. Christian Kuhn merged patch set 5 01/24/22, 09:38