Posted by husainsn on January 30, 2010 at 12:38am
Hello
I have node type with location data. I want to access latitude and longitude data to calculate Sunrise time in a computed field - but no success. The code in computed field (on the same node) is:
$lat = $node->$location[latitude];
$long = $node->$location[longitude];
$node_field[0]['value'] = date_sunrise(time(), SUNFUNCS_RET_STRING, $lat, $long, 90, -5);
I can access latitude data $location[latitude] in the theme override.
Any help will be appreciated.
Comments
Module weight?
I'm just guessing, but this could be something to do with module weight. You'd have to have the computed field module lower down the execution order than location for it to be able to access location's fields.
Or then again, that could be way off-base but it's worth a look and a slight tweak?
Thanks, but no joy
Could one have to refer $location[latitude] differently?
Shifting module weights?
How I can shift module/CCK field weights cause I think I have similar problem while accesing field values which as dev load shows is loading later than my computed field. I think thats what causing problems with getting empty computed field.