drupal_placeholder() takes an array as an argument, which is weird. One would expect it to take a string as an argument. Furthermore, there seems to be no reason to use an array, since it seems only one element of the array is ever used. Furthermore, at every place the function is called, the array is specifically created for that function, and seems to serve no other purpose. I realize that this is rather late for an API change, but in a function like t() that may be called thousands of times on a page load, we cannot really afford to have inefficiencies. Plus, it'll make for a much cleaner API.
I'll have a patch for this tonight.
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal_placeholder_02.patch | 6.96 KB | cwgordon7 |
#1 | drupal_placeholder_01.patch | 6.88 KB | cwgordon7 |
Comments
Comment #1
cwgordon7 CreditAttribution: cwgordon7 commentedAnd here's the patch.
Comment #3
cwgordon7 CreditAttribution: cwgordon7 commentedComment #4
chx CreditAttribution: chx commentedI bet this was just theme_placeholder ported without thinking.
Comment #5
Dries CreditAttribution: Dries commentedCertainly a major WTF. Committed to CVS HEAD.
Comment #6
rfayI assume this needs to be announced. Or is it unlikely that anybody would use this directly?