Closed (fixed)
Project:
Drupal core
Version:
4.7.x-dev
Component:
theme system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
12 Jun 2005 at 18:16 UTC
Updated:
26 Dec 2006 at 01:35 UTC
Jump to comment: Most recent file
Comments
Comment #1
adrian commentedi am gonna +1 this, as it simplifies the available variables.
Comment #2
Bèr Kessels commentedI Add my +1 to the 'heap' too. But a slight additional feature:
Maybe we should then omit teh $node completely. It makes not much sense IMO to use the overheard of parsing along a rather often-used, and big varible, when its availabe in another form already
Maybe you should do some checking for already existing variables. One nevver really knows w
Ber
Comment #3
morbus iff+1 to the flat, -1 to removing $node. I use various functions within my templates that require a $node object to be passed to them.
Comment #4
chx commentedMorbus is right.
Comment #5
chx commentedDries is also right that some code can be removed.
Comment #6
dries commentedCommitted to HEAD.
Comment #7
morbus iffThis patch causes a small bug with $picture. There exists a $node->picture (the relative URL to the submitter's picture) and a variables['picture'] (whether or not to show avatars within a template). chx kindly ensures that the $variables array always overrides anything in $node with $variables = array_merge(object2array($node), $variables);. But, this doesn't work if the template avatars have been set to OFF/Disabled/NULL in the template settings. Since it's set to off, the $node->picture gets seeded and the templates, checking on the existence of $picture, now spit out the relative URL to the picture. The attached patch turns renames $variable['picture'] to $variable['show_picture'].
This shoudn't be an issue with comment pictures, because $comment is not flattened.
Comment #8
morbus iffComment #9
chx commentedthanks Morbus. I have not played with $comment 'cos you can't extend comment like you can node.
Comment #10
morbus iffSomehow, I forgot bluemarine.
Comment #11
dries commentedTo me it makes more sense to merge $show_picture and $picture. If we have a picture to show, set $picture. If we don't have a picture to show, make sure $picture is NULL. One variable is better than one, and gets the job done IMO.
Comment #12
drummI agree one variable is better than two.
Comment #13
Jaza commentedThis issue appears to be fixed by the existence of the 'toggle_node_user_picture' variable in PHPTemplate. Closing.