Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
According to the comment of ctools_set_page_token()
callback tokens support the usage of arguments. Unfortunately ctools_set_callback_token()
isn't argument aware.
A good example for that is the page element Page title - you can use this element multiple times on a page but only the settings of the last element are applied.
This is because, no matter how you configure the element, the used token is always <!-- ctools-page-title -->
.
The attached patch changes the token creation to add a hash of the callback definition if the argument structure is used.
Comment | File | Size | Author |
---|---|---|---|
#2 | ctools-callback-token-respect-arguments-1319872-2.patch | 920 bytes | das-peter |
ctools-callback-token-respect-arguments.patch | 604 bytes | das-peter |
Comments
Comment #1
das-peter CreditAttribution: das-peter commentedAn easy way to reproduce this issue is to place the page element
Page Title
twice on a page.Configure the first "instance" to use the h1-tag, the second one to use the h2-tag.
Now if you view the page you'll recognize that both "instances" of the page title are displayed with the h2-tag.
Comment #2
das-peter CreditAttribution: das-peter commentedAs suggested by merlinofchaos via IRC, patch changed to use
md5()
for performance reasons.Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedI believe this needs a backport to D6. It may be as simple as cherry-pick but I would need someone to check.