See patch.

Should the array key be 'book' or 'node' when the type is 'node'? When it's 'book' - in the original code - ctools context breaks. Almost no tokens are available. When changed to node - it all works fine.

Comments

dave reid’s picture

Status: Needs review » Closed (works as designed)

That part of the array only controls how the tokens are grouped. It does not have to match the $type parameter. You'll find CCK does the same thing.

willieseabrook’s picture

Status: Closed (works as designed) » Needs review
StatusFileSize
new84.66 KB
new64.83 KB

Reopening. I'm certain there is a problem here.

See the attached screenshots.

oldcode.png shows what I see in a panels view edit using the 6.x-1.15 code, newcode.png shows what I see with my patch applied.

My patch may be a sub-optimal solution, but there is certainly a problem here. As you can see in the screenshots, the list of available tokens is destroyed when book module is enabled.

The next question is, is this a panels/context issue or a tokens issue?

I've debugged through token_get_list, and dumping $return, shows that's where the issue first occurs. Ctools/context is simply using what it's given by token_get_list, and when book_token_list is used, token_get_list is returning almost no values.

To repeat the issue:

1. Install panels, views, ctools etc, tokens.
2. Create a view with an argument. Any view.
3. Create a panel node and add the view to the panel.
4. In panel content tab, click settings on the view pane. You will see all the tokens available.
5. Enable book module.
6. In panel content tab, click settings on the view pane. --> You see only a handful of tokens.

dave reid’s picture

Then Panels is choosing to only display $tokens['node'] and not all the tokens possible.

willieseabrook’s picture

If panels was only requesting "node", then turning book module on/off should have no effect.

However, when book module is turned on, all the "node" tokens disappear.

Thinking out loud here.

This implies either panels is requesting "all", and can't handle the case where get_token_list returns more than a single category,

or,

there is some issue with the get_token_list function not working well when all is requested and multiple categories of tokens is returned.

I'll do some more debugging on this and see *exactly* what is happening then report back.

dave reid’s picture

Status: Needs review » Postponed (maintainer needs more info)

@willieseabrook: Any update? I'm guessing this falls under "panels ... can't handle the case where get_token_list returns more than a single category"

dave reid’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

No response in over a month, so marking as works as designed.