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

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 9