I'm creating an install profile and I just can't seem to get my blocks enabled.
When I check the database after using the code below in my install function it puts the records in the block table, but the status is set to 0 and the region detail isn't inserted.
I'm using code from other install profiles and I can't see why mine isn't working - works fine on things like the erecruiter profile, the omega profile, but whenever I try it never works! Anyone experienced similar?
// Enable some standard blocks.
$default_theme = 'mytheme';
$admin_theme = 'seven';
$values = array(
array(
'module' => 'system',
'delta' => 'main',
'theme' => $default_theme,
'status' => 1,
'weight' => 0,
'region' => 'content',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'node',
'delta' => 'recent',
'theme' => $admin_theme,
'status' => 1,
'weight' => 10,
'region' => 'dashboard_main',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'user',
'delta' => 'login',
'theme' => $default_theme,
'status' => 1,
'weight' => 0,
'region' => 'sidebar_first',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'navigation',
'theme' => $default_theme,
'status' => 1,
'weight' => 0,
'region' => 'sidebar_first',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'powered-by',
'theme' => $default_theme,
'status' => 1,
'weight' => 10,
'region' => 'footer',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'help',
'theme' => $default_theme,
'status' => 1,
'weight' => 0,
'region' => 'help',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'main',
'theme' => $admin_theme,
'status' => 1,
'weight' => 0,
'region' => 'content',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'help',
'theme' => $admin_theme,
'status' => 1,
'weight' => 0,
'region' => 'help',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'user',
'delta' => 'login',
'theme' => $admin_theme,
'status' => 1,
'weight' => 10,
'region' => 'content',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'user',
'delta' => 'new',
'theme' => $admin_theme,
'status' => 1,
'weight' => 0,
'region' => 'dashboard_sidebar',
'pages' => '',
'cache' => -1,
),
);
$query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
foreach ($values as $record) {
$query->values($record);
}
$query->execute();