Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 Apr 2013 at 13:48 UTC
Updated:
14 Feb 2014 at 00:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
merlinofchaos commentedAre you sure this is really the -dev version: There are problems in 7.x-1.2 with chained tokens, but those are all fixed in the latest release, to my knowledge.
Comment #2
rafaqz commentedI double checked some typos and its actually only happening in current-page:query:x, I've done a few tests replacing the token in custom content and it dosn't seem to work anywhere.
it is the current dev, but it seems to be a different problem as the other tokens are all working, maybe a tokens issue?
Comment #3
rafaqz commentedan example to illustrate the problem:
I put this substitution token somewhere substitutions are checked (in text, titles, cache cid etc...)
%token:current-page:query:foo
the page is loaded with a query string of ?foo=bar
But the substitution leaves no text, when it should return "bar"
Thats how it seems it should work from this test at least
Comment #4
rafaqz commentedctools_context_token_convert wasn't returning anything for tokens with three or more parts, here's a patch.
Comment #5
rafaqz commentedComment #7
rafaqz commentedComment #8
merlinofchaos commentedIs it possible to get a token into there that won't explode correctly leaving parts[0] undefined and causing a notice error?
Comment #9
rafaqz commentedprobably not, its copied from the validation in the token module.
token.module:651: $parts = explode(':', $token, 2);token.module:653: if (!isset($token_info['tokens'][$type][$parts[0]])) {Comment #10
moonray commentedThe patch in #7 fixes the issue. Haven't noticed any errors/notices so far.
Comment #11
kalabroThe problem in current 7.x-1.x-dev code is that Ctools tries to check something like this
query:fooinstead of justquery.So #7 fixes problem and looks good.
Comment #12
kalabroUpdate title to clarify problem.
Tokens like:
aren't replaced by Token context. Patch from #7 fixes it.
Comment #13
johnennew commentedConfirm the patch in #7 fixes a bug when using path_breadcrumbs module and trying to access the current og_context via the site token:
Many thanks!
Comment #14
podarok#7 simple fix
RTBC
Comment #15
Jorrit commentedIt works for me when accessing %token:current-page:query:xyz in a pane title, thanks! I wonder why the
if (isset($tokens['tokens'][$real_type][$parts[0]])) {part is there at all. Does it hurt for the code to be a bit more optimistic and hand over everything totoken_generate()without a check?Comment #16
rafaqz commentedI was also wondering if we could just delete those lines as well, just left it in to be safe assuming someone had validation there for a reason. But token runs exactly the same validation immediately after this runs so its not really needed.
Comment #17
dillix commented+1 for RTBC
Comment #18
ntigh52 commented#7: ctools-current-page-query-token-not-returned-1964434-7.patch queued for re-testing.
Comment #19
dillix commented#7: ctools-current-page-query-token-not-returned-1964434-7.patch queued for re-testing.
Comment #20
dillix commented2 merlinofchaos: is this patch on the latest dev?
Comment #21
japerryFixed and Committed:
http://drupalcode.org/project/ctools.git/commit/b6d4112c86d4168b214c7336...