Closed (fixed)
Project:
Basic
Version:
7.x-2.0-rc3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2011 at 20:40 UTC
Updated:
31 Jul 2017 at 03:28 UTC
Jump to comment: Most recent
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
Comment #1
e-m-h commentedAlso 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:
References: http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ht... and http://drupal.org/node/624046
Comment #2
see15_aug commentedThanks. It's helps me
Comment #3
SteveK commentedthanks. pushed to dev.
Comment #5
coozila commentedtanks its help me
Comment #6
calvez commentedThank you, it's applicable to:
http://www.templatemonster.com/drupal-themes/53894.html
Comment #7
Kat_bast commentedThanks it worked for template monster theme822