Custom theme doesn't show up in Blocks section-Collection of common programming errors
The error you are getting is caused from the fact the name is missing from the .info file for your theme.
In block_menu(), the code that is causing the error is the following one.
$items['admin/structure/block/list/' . $key] = array(
'title' => check_plain($theme->info['name']),
'page arguments' => array($key),
'type' => $key == $default_theme ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
'weight' => $key == $default_theme ? -10 : 0,
'access callback' => '_block_themes_access',
'access arguments' => array($theme),
'file' => 'block.admin.inc',
);
$items['admin/structure/block/demo/' . $key] = array(
'title' => check_plain($theme->info['name']),
'page callback' => 'block_admin_demo',
'page arguments' => array($key),
'type' => MENU_CALLBACK,
'access callback' => '_block_themes_access',
'access arguments' => array($theme),
'theme callback' => '_block_custom_theme',
'theme arguments' => array($key),
'file' => 'block.admin.inc',
);
In system_menu(), the code causing the error is the following one.
foreach (list_themes() as $theme) {
$items['admin/appearance/settings/' . $theme->name] = array(
'title' => $theme->info['name'],
'page arguments' => array('system_theme_settings', $theme->name),
'type' => MENU_LOCAL_TASK,
'access callback' => '_system_themes_access',
'access arguments' => array($theme),
'file' => 'system.admin.inc',
);
}
In all the cases, the error is raised when Drupal tries to access $theme->info['name']
, but the “name” index is not defined.
Be sure there isn’t any strange Unicode character before name =
, especially an invisible character.
If you are editing the .info file of the theme when the theme is enabled, you need to first disable it, and re-enable it, as the content of the .info file is cached.