Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
FileSize
2.3 KB

Here is a patch that fixes it in token.module by adding a prefix to the used id's.

The prefix is only added if there is more than a single table, this could easily be changed add one by default.

Patch is quite simple I think :)

fago’s picture

hm, why not use classes instead of ids if its not unique? Or, drupal_html_id() ?

Berdir’s picture

Could also use drupal_html_id(), the problem is that it is a mix of an id and classes. First, we add an id, which needs to be unique and then we have a number of classes (all rows that have the previous with the id as the parent) which need to reference to that id.

But yeah, it might be possible to use drupal_html_id() once then then re-used what has been returned.

Dave Reid’s picture

moonray’s picture

Subscribe.

Dave Reid’s picture

Using drupal_html_id will not allow us to cache the token tree's output. And modifying the library to use classes rather than IDs is a bigger step then it looks. Please try the following patch which changes the behavior of the childrenOf and parentOf functions to search only the 'current' treeTable.

Dave Reid’s picture

Dave Reid’s picture

Even better which uses .siblings().

Dave Reid’s picture

Status: Fixed » Closed (fixed)

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

clemens.tolboom’s picture