Problem/Motivation

The function drupal_html_id() adds an incremental counter to the end of the string, based on the numbers of elements existing on the page and it's keeping saved values in the $drupal_static.

Steps to reproduce

It makes a problem when we create our custom function THEME_preprocess_bootstrap_tabs() and want to replace $id to be the following:
$id = drupal_html_id($item['#title'])
and it's always adding an incremental suffix (--2) on the end of the string because it executes first the main function template_preprocess_bootstrap_fieldgroup_nav().

Proposed resolution

My suggestion is to apply the whole string through drupal_html_id() as this is the target HTML element ID.

CommentFileSizeAuthor
#2 bootstrap_fieldgroup-3223827.patch1.59 KBpiotrsmykaj

Comments

piotrsmykaj created an issue. See original summary.

piotrsmykaj’s picture

StatusFileSize
new1.59 KB

Please someone about review.

piotrsmykaj’s picture

Status: Active » Needs review
piotrsmykaj’s picture

Issue summary: View changes
piotrsmykaj’s picture

Issue summary: View changes

  • piotrsmykaj authored 0b79eff on 7.x-1.x
    Issue #3223827 by piotrsmykaj: drupal_html_id() should be applied to...
cha0s’s picture

Thanks! It's committed to dev.

cha0s’s picture

Status: Needs review » Fixed
piotrsmykaj’s picture

@cha0s Thanks for the rapid response!

Status: Fixed » Closed (fixed)

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