I get the following error on enabling the Basic theme on my D7 website

Notice: Uninitialized string offset: 0 in basic_id_safe() (regel 120 van /var/www/d7/sites/all/themes/basic/template.php

It refers to is

<?php
function basic_id_safe($string) {
 
// Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.
 
$string = strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '-', $string));
 
// If the first character is not a-z, add 'n' in front.
 
if (!ctype_lower($string{0})) { // Don't use ctype_alpha since its locale aware.
   
$string = 'id'. $string;
  }
  return
$string;
}
?>

Comments

Also am seeing this error. After a little research found that there are some new functions in D7 that handle cleaning up classes. Replacing the above function with this seems to do this trick:

<?php
function basic_id_safe($string) {
 
// Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.
 
$string = drupal_html_id($string);
  return
$string;
}
?>

References: http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ht... and http://drupal.org/node/624046

Thanks. It's helps me

Status:Active» Fixed

thanks. pushed to dev.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.