To template.php in Boilerplate :
function mon_vintage_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;
}
Why on my page I have the warning?:
Notice : Uninitialized string offset: 0 dans mon_vintage_id_safe() (ligne 150 dans C:\wamp\www\respecte-moi.fr\sites\all\themes\boilerplate\template.php).
Thank you for your help
Comments
Comment #1
danlinn commentedI replied to this on my personal blog: https://www.metaltoad.com/blog/boilerplate-10-drupal-7-responsive-html5-...
Comment #2
pjnes commentedI ran into this same issue, and it wasn't down to the naming issue. I've grepped the theme folder for the word boilerplate and it only finds the mentions in the Readme folder.
Something was sending an empty string to themename_id_safe(). Adding a check to see if the string is not empty before attempting to check the first character fixes it.
I'm reopening this just so it gets noticed, unfortunately I don't have time to roll a patch.
Comment #3
grendzy commentedLet's just get rid of it, D7 already has a function making class names.
Comment #4
grendzy commentedcommitted #3.
Comment #5
Yunus260 commented#2 helped me, thx