/**
 * Convert a group label to a usable HTML id attribute.
 */
function _bootstrap_fieldgroup_label_to_id($title) {
  return preg_replace('/[^0-9a-z]/', '-', drupal_strtolower($title));
}

This function prepares group label to be used in tab's link href attribute by replacing all non-numeric and non-latin symbols with '-'. So, if group label is not en English, but e.g. in Russian, this function replaces every symbol with '-', producing something like '----------------------------'. As a result, if two groups have different labels of the same length, their link href attribute turns out to be the same, and one of the groups becomes inaccessible.

This function should process non-latin labels properly. I suggest using /\W/u regexp, which supports unicode, see patch in comment #1.

Comments

Shevchuk’s picture

Shevchuk’s picture

Status: Active » Needs review
Shevchuk’s picture

StatusFileSize
new514 bytes

Updated regexp for better support of older PHP versions: it looks like \W doesn’t work as expected in 4.4.0-5.3.3 (see http://3v4l.org/YeMpR). Thanks tomoe-mami from #php at freenode.

cha0s’s picture

Thanks for the patch! It's committed in the 7.x-1.1 release. :)

cha0s’s picture

Status: Needs review » Closed (fixed)