Hello,

I'm creating an installation profile. I've added two form tasks and one batch. I'm also using a custom theme (zen starter kit) during the installation.

After I pass the Configure Site task (site name, email, region, etc) and on to my first custom task, the system cache seems to be cleared somehow. After many hours of tracking down the problem I've noticed that the {system} table is being cleared of all contrib/custom modules and themes. Only core themes and modules and the currently used zen starterkit remain in the table. On the next form submission I'm getting the wsod since files are missing.

Maybe I'm missing something obvious. Hope someone can help.

Best regards.

Comments

nlambert’s picture

Title: Installation profile breaks » How to properly use a custom them during the installation process

Without a custom theme, the installation completes nicely.

I was clueless in how to activate a custom theme for the installation process, so I copied commerce kickstart's method and have probably left something out:

function commerce_kickstart_install_tasks_alter(&$tasks, $install_state) {
...
_commerce_kickstart_set_theme('commerce_kickstart_admin');
...
}

function _commerce_kickstart_set_theme($target_theme) {
  if ($GLOBALS['theme'] != $target_theme) {
    unset($GLOBALS['theme']);

    drupal_static_reset();
    $GLOBALS['conf']['maintenance_theme'] = $target_theme;
    _drupal_maintenance_theme();
  }
}

I've revised my question: how to properly use a custom theme during the installation process?

I also have a secondary question: what is happening to the system table between the database creation step, site configuration and the last step. Why does the system table get "flushed" and rebuilt again? It appears this isn't happening during the commerce kickstart installation process. I'm going to try to figure out why.

I simply ran the following query at different times during the installation:

select filename, name, type, owner, status, bootstrap, schema_version, weight from system;

When the database is first created, the system table (in my case) has 270 rows; after the Site Configuration step the number of rows drops by about 100; after the last step the number of rows pops back up to 270.

nlambert’s picture

The base theme info is being left out of the system table.

I don't know what magic has been done in commerce kickstart to avoid this situation (for they are also using a base theme), but here is my quick fix:

  if (in_array('install_bootstrap_full', $install_state['tasks_performed'])) {
    system_rebuild_theme_data();
  }

I could probably check if the zen base theme info is in the system table first before calling system_rebuild_theme_data, but it works.

Version: 7.23 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.