Hi
I have an interesting issue, I have a content type set up with date field and a lot of other fields inside a fieldgroup. The date field is displayed in views using the content type, but not in the node body.
Printing the $node->field_date[0]['value'] and $node->field_date[0]['value'] both return nothing in when printed out in node.tpl.php, and a print_r($node->field_date) in node.tpl.php returns:
Array
(
[0] => Array
(
[view] =>
)
)
However when I enable devel module and check the 'Devel node' and 'devel render' tabs $node->field_date[0]['value'] and $node->field_date[0]['value2'] the values are displayed just as they are stored in the database.
The dates were displaying when I initially configured things, but now they are not, and I can't really figure out what has happened in the meantime. If anyone can suggest any possible leads of enquiry to follow that would be great.
I have this with the latest dev, php 5.2.6, and all troubleshooting steps followed. I am attaching an export of my date field.
| Comment | File | Size | Author |
|---|---|---|---|
| date_field.txt | 2.92 KB | nirbhasa |
Comments
Comment #1
nirbhasa commentedInstead of 'Devel node' and 'devel render', I of course meant 'Dev load' and 'Dev render'. Sorry.
Comment #2
nirbhasa commentednow, when I create a node the field appears in the node, but it doesnt appear for existing node. Which leads me to suspect it might have something to do with an older version of date module I had patched.
Comment #3
nirbhasa commentedOpening again - I made date field reappear once but cannot recreate it. Also, looking at the sql queries for db (with caching turned off), it doesnt appear that the content_field_date table where the dates are stored is being queried at all.
Comment #4
nirbhasa commentedIt seems that basically the date fields of the node object aren't loading properly in node view. I still don't know why, but I managed to work around it by creating this function in template.php
I had to comment out a couple of places in the theme function where it returned early due to lack of node info.
Closing issue for now.