did i miss something?

situation 1:
in preprocess function i write:

hide($variables['field_tag']);

but dpm($variables) in tempalte still output
$...['field_tag']['#printed'] as TRUE,
on /node/xxx

situation 2:
in preprocess function i write:

$variables['field_tag'][0]['taxonomy_term']->name = 'michaeljackson';

but dpm($variables) in tempalte still output
$...['field_tag'][1]['taxonomy_term']->name as before
in /node/xxx


overall in template.php code is like

hide($variables['field_tag']);
$variables['field_tag'][0]['taxonomy_term']->name = 'michaeljackson';
dpm($variables);

did i miss something.
hope some one can help us make it clear

ps i cleared cache.

thank u very much in advance.
thanks.

Comments

Ayesh’s picture

I have a strong feeling that you didn't pass $variable by reference.

function FOO_preprocess_bar(&$variables) { // See that & sign?

}
qqboy’s picture

sorry but i have to tell u
wrong
i do passed & infront it.
if not, then no matter what i do there will be no changes.

the strange thing is
i need to print something extra to activate changes
or log in and out to activate it.
is it normal or i miss something?

thanks.

Jaypan’s picture

You haven't shown us enough code to be able to help.