In a recent patch we added preprocess functions for theme functions.
Unfortunately, theme functions received a fixed list of variables. All a preprocess function can do is modify them. This has 2 problems: 1) new variables cannot be added, and 2) any changes to existing variables destroys data. Both of these turn this into a very hard to use DX WTF. For an example of this, see the discussion on http://drupal.org/node/565792
My proposed solution is simple: All theme functions receive exactly one argument, and that argument is the $variables array that preprocess functions get fed. It does mean that there is an API shift on existing theme functions, but I think this is an important one:
1) Theme functions are now used MUCH less than templates and
2) It allows theme functions to make proper use of preprocess where it makes sense.
Before putting in a patch, I'd like to elicit some discussion.
Comments
Comment #1
merlinofchaos commentedhttp://drupal.org/node/572618
Comment #2
joshmillerComing from a themer... +1
Comment #3
joshmillercross post
Comment #4
Zarabadoo commentedAlso a themer, and I am in approval.