I am using Drupal 7 and I have added some code to my template.php file in my theme (which I found on a Drupal tutorial) so I can use a custom template for the user login form. The form works and it is using the custom template but it is generating these errors:
Notice: Undefined index: classes_array in template_process() (line 2527 of /includes/theme.inc).
Warning: implode(): Invalid arguments passed in template_process() (line 2527 of /includes/theme.inc).
Notice: Undefined index: attributes_array in template_process() (line 2533 of /includes/theme.inc).
Notice: Undefined index: title_attributes_array in template_process() (line 2534 of /includes/theme.inc).
Notice: Undefined index: content_attributes_array in template_process() (line 2535 of /includes/theme.inc).
The code I have in my template.php file is:
function cr_theme() {
$items = array();
$items['user_login'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'cr') . '/templates',
'template' => 'user-login',
'preprocess functions' => array(
'cr_preprocess_user_login'
),
);
return $items;
}
function cr_preprocess_user_login(&$vars) {
$vars['forgot_link'] = l(t('Forgot password?'),'user/password');
}
and my user-login.tpl.php file contains:
<div class="cr-user-login-form-wrapper">
<?php print drupal_render_children($form) ?>
<p style="margin-top:12px;"><?php print render($forgot_link); ?></p>
</div>
I have been trying to find the cause of the errors which I think is probably something I have not added to my cr_theme() function but now need some help.