I have a situation where ctools_page_token_processing() is processing a 'callback' type token where the callback function is 'ctools_page_title_content_type_token'.
That function lives in ctools/plugins/content_types/page/page_title.inc, and when the function_exists() check is made, it fails, indicating that the include file has not been loaded.
The only other instance of the string 'ctools_page_title_content_type_token' in my code base is also in page_title.inc where this token is set by ctools_page_title_content_type_render(), so I figured it must be related to caching. Sure enough, if I clear the caches this problem disappears for the first page view, and returns for the subsequent views.
The visible symptom of this bug is the error: "Notice: Array to string conversion in strtr()", because the 'callback' case of that switch statement had no effect, and consequently the array value for that particular $tokens[$token] was retained when strtr($children, $tokens); was called.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1365522-4-page_title-cache.patch | 524 bytes | joelpittet |
Comments
Comment #1
jweowu commentedSee also this same bug for Drupal 6 #949098: Notice: Array to string conversion in ctools_preprocess_page
Comment #1.0
jweowu commentedadded error message for searchability
Comment #2
Exploratus commentedSubscribe!
Comment #3
robinmofo commentedIf for some reason you're getting this issue, you can easily include the file in hook_panels_pre_render() in order to fix the include issue.
It might save someone some time, my page titles were printing 'Array'.
Comment #4
joelpittetThis is a long standing bug apparently, I worked with @brunodbo today to get to the bottom of this. Here's a solution to get the includes working for the content_types plugin. It only works for ctools content plugins, not custom ones, but
page_titleis the only one that implements this token replacement hook ctools.Thanks also for the workaround @frobinrobin, that can work as a workaround for any custom implementations still.
Thoughts on this approach?