In D6, token replacements (like page_title, page_footer_message, etc) were done through a preprocess hook on the page. That has been moved to a post_render callback now that will give us access to the entire rendered page.

Comments

eclipsegc’s picture

Status: Active » Needs review
StatusFileSize
new1.24 KB
merlinofchaos’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

azinck’s picture

Status: Closed (fixed) » Needs work

This change is rather disruptive and, frankly, seems to break the API. The #post_render callback does have the advantage of passing the entire rendered content of the page (thus letting you parse/replace tokens in the entire rendered content), but it doesn't give you access to all the variables provided to hook_preprocess_page (like the page title). Frankly, the #post_render callback gives us very little access to anything useful in the way of variables.

Not only that, but ctools_page_token_processing() now refers to a $variables array which is no longer passed in. See #1964874: $variables not injected properly into ctools_page_token_processing() .

I don't know the direction we want to go here. The fact that this has been effectively broken for 3 years and no one's complained makes me think that we can keep things mostly as-is and just rename the references to $variables to instead refer to $elements. It's not that useful ($elements contains little of use) but it's the least disruptive option to the API and allows us to use callback tokens without incurring errors.

azinck’s picture

Status: Needs work » Needs review
StatusFileSize
new2 KB
saltednut’s picture

Assigned: eclipsegc » Unassigned
Issue summary: View changes

Still in need of review. Unsure why assigned to Eclipse still, but that seems off...

  • Commit 7fae3de on 7.x-1.x authored by azinck, committed by japerry:
    Issue #955070 by azinck, EclipseGc: Update the token replacements in...
japerry’s picture

Status: Needs review » Fixed

Yup, I agree with Aaron that the original change wasn't optimal -- this patch should remove the errors; it tested good for me, and its committed now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.