Enabling blocks in an install profile 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' =&gt; 'system',
  'delta' =&gt; 'main',
  'theme' =&gt; $default_theme,
  'status' =&gt; 1,
  'weight' =&gt; 0,
  'region' =&gt; 'content',
  'pages' =&gt; '',
  'cache' =&gt; -1,
),
array(
  'module' =&gt; 'node',
  'delta' =&gt; 'recent',
  'theme' =&gt; $admin_theme,
  'status' =&gt; 1,
  'weight' =&gt; 10,
  'region' =&gt; 'dashboard_main',
  'pages' =&gt; '',
  'cache' =&gt; -1,
),
array(
  'module' =&gt; 'user',
  'delta' =&gt; 'login',
  'theme' =&gt; $default_theme,
  'status' =&gt; 1,
  'weight' =&gt; 0,
  'region' =&gt; 'sidebar_first',
  'pages' =&gt; '',
  'cache' =&gt; -1,
),
array(
  'module' =&gt; 'system',
  'delta' =&gt; 'navigation',
  'theme' =&gt; $default_theme,
  'status' =&gt; 1,
  'weight' =&gt; 0,
  'region' =&gt; 'sidebar_first',
  'pages' =&gt; '',
  'cache' =&gt; -1,
),
array(
  'module' =&gt; 'system',
  'delta' =&gt; 'powered-by',
  'theme' =&gt; $default_theme,
  'status' =&gt; 1,
  'weight' =&gt; 10,
  'region' =&gt; 'footer',
  'pages' =&gt; '',
  'cache' =&gt; -1,
),
array(
  'module' =&gt; 'system',
  'delta' =&gt; 'help',
  'theme' =&gt; $default_theme,
  'status' =&gt; 1,
  'weight' =&gt; 0,
  'region' =&gt; 'help',
  'pages' =&gt; '',
  'cache' =&gt; -1,
),
array(
  'module' =&gt; 'system',
  'delta' =&gt; 'main',
  'theme' =&gt; $admin_theme,
  'status' =&gt; 1,
  'weight' =&gt; 0,
  'region' =&gt; 'content',
  'pages' =&gt; '',
  'cache' =&gt; -1,
),
array(
  'module' =&gt; 'system',
  'delta' =&gt; 'help',
  'theme' =&gt; $admin_theme,
  'status' =&gt; 1,
  'weight' =&gt; 0,
  'region' =&gt; 'help',
  'pages' =&gt; '',
  'cache' =&gt; -1,
),
array(
  'module' =&gt; 'user',
  'delta' =&gt; 'login',
  'theme' =&gt; $admin_theme,
  'status' =&gt; 1,
  'weight' =&gt; 10,
  'region' =&gt; 'content',
  'pages' =&gt; '',
  'cache' =&gt; -1,
),
array(
  'module' =&gt; 'user',
  'delta' =&gt; 'new',
  'theme' =&gt; $admin_theme,
  'status' =&gt; 1,
  'weight' =&gt; 0,
  'region' =&gt; 'dashboard_sidebar',
  'pages' =&gt; '',
  'cache' =&gt; -1,
 ),
);
$query = db_insert('block')-&gt;fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
foreach ($values as $record) {
  $query-&gt;values($record);
}
$query-&gt;execute();
Are you using the Profiler library to drive your installation profile? If so, there's a "feature" in the 7.x-2.0-beta1 release that causes this behavior. In short, there's some legacy code that disables all blocks in the database upon installation.

If you're using the Profiler module, upgrade to the latest development snapshot to get the fix.