Problem/Motivation

If a hook_install_task_alter adds a form immediately after Install_base_system it will not use the maintenance theme. This bug was discovered whilst implementing https://www.drupal.org/project/config_installer. This occurs because FormBuilder::prepareForm() calls ThemeManager::alter() which requires the active theme to be set.

Proposed resolution

Check that the install task has not reset the active theme and set the maintenance theme if necessary.

Remaining tasks

  • Review
  • Commit

User interface changes

None

API changes

None

CommentFileSizeAuthor
#3 2385545.3.patch898 bytesalexpott
#3 1-3-interdiff.txt1.02 KBalexpott
#1 2385545.1.patch939 bytesalexpott

Comments

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new939 bytes
yched’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/core/includes/install.core.inc
@@ -485,6 +485,12 @@ function install_run_tasks(&$install_state) {
+    // Ensure the maintenance theme is initialized. If the install task has
+    // rebuilt the container by, for example, installing a module the active
+    // theme will not be set.

Nit: a comma after "installing a module" would make the sentence easier to parse ?

Other than that, I'm not really familiar with the installer not the theme negociation, but this "looks good"...
Temptative RTBC, and maybe core committers can think of a more appropriate person to vet this ?

alexpott’s picture

StatusFileSize
new1.02 KB
new898 bytes

Fixed comment. Actually the if is superfluous since this is checked in _drupal_maintenance_theme()

Talked about this with @dawehner in IRC. He suggested adding a @todo to remove all the maintenance theme setting in the installer and override this on the container level. However I feel that is way beyond the scope of this issue. We would have to add the @todo's to all the places in the installer where the maintenance theme is initialised. The patch attached continues to fix this in the same way as in other places in the installer. For example, see install_display_output()

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed f72f1e8 on
    Issue #2385545 by alexpott: Installer can generate unthemed pages
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.