Closed (outdated)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2012 at 19:42 UTC
Updated:
20 Jul 2026 at 20:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bart.hanssens commentedSame issue here. Backtrace from devel module
Comment #2
bart.hanssens commentedQuick and dirty patch, may break other stuff...
It appears that the preg_match_all in ctools_context_keyword_substitute() only matches the first part of the token (e.g. current-date instead of current-date:long)
Tested it with %token:current-date:long as title
Comment #3
bart.hanssens commentedComment #5
bart.hanssens commentedPatch with unix line-endings
Comment #6
christoph commentedThis patch worked for me. Thanks.
Comment #7
dig1 commentedGreat job.
I updated to: Drupal core 7.15, Calendar 7.x-3.4+0-dev (2012-May-20), Chaos tool suite (ctools) 7.x-1.2+3-dev (2012-Sep-19), Date 7.x-2.6, Entity API 7.x-1.0-rc3+10-dev (2012-Sep-07), Panels 7.x-3.3+1-dev (2012-Sep-07) and straight away I was getting multiple errors stating:
Notice: Undefined offset: 1 in ctools_context_token_convert() (line 53 of .../sites/all/modules/ctools/plugins/contexts/token.inc).specficially this applied when I used %token:current-date:calendar and %token:site:name as substitutions.
- I downloaded this patch to the directory...sites/all/modules/ctools/includes
- Issued the command 'patch < ctools-token_in_panel-1770670-4.diff'
- the response was 'patching file context.inc'
and then the errors disappeared from my site.
Success and thank you bart.hanssens
Comment #8
areynolds commentedI didn't experience the "Undefined offset" described in the original issue, but I was experiencing token replacement issues using date tokens combined with formaters (%node:created:short, for example) in 7.x-1.x-dev and this patch has fixed them. Thanks!
Comment #9
goodeit commentedThis is a duplicate of https://drupal.org/node/1727804.
The patch at https://drupal.org/node/1727804#comment-6395400 is the same as #5 here and includes a test case to prevent a regression.
Comment #10
elly commentedThank you, this patch worked for me against latest ctools dev.
Comment #11
renegaed commentedthe patch worked for me however token replacement is not working for the following types of patterns that exclude the % sign:
<a href="[token:site:url]login">Login</a>
the token is not being replaced in panel panes custom content block. Any help would be greatly appreciated. Thank you.
Comment #12
renegaed commentedComment #13
moonray commentedThis is still an issue with
%token:current-page:url.The patch in #5 fixed the notice and the token.
Comment #14
summit commentedHi, shouldn't this than be RTBC?
Greetings, Martijn
Comment #15
podarok#14 nope, due to #11
Comment #16
pirog commentedThis seems to be in 1.3 already...
Comment #17
JayShoe commentedHello,
I'm having a similar problem with Panels and Tokens. I stumbled upon this thread. Can someone please tell me if this is resolved? That is - are custom tokens supposed to work on panels?
Here is my issue #2151127: Entity Tokens do not display when rendered via Content Pane in Panels
Comment #18
japerryDrupal 7 is no longer supported, closing.