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

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

e-m-h’s picture

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:

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

see15_aug’s picture

Thanks. It's helps me

SteveK’s picture

Status: Active » Fixed

thanks. pushed to dev.

Status: Fixed » Closed (fixed)

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

coozila’s picture

Issue summary: View changes

tanks its help me

calvez’s picture

Kat_bast’s picture

Thanks it worked for template monster theme822