Greetings Drupal experts!

Running Drupal 5.3, current modules, and under either PHP4 or 5 I have an issue that I can't seem to figure out.

I have a CCK content type to which I have just added a date field.

Using the excellent write up at http://drupal.org/node/92460 I selected a Datestamp(Unix Timestamp)to best match the node created date format. The field is required, my Widget is a Text Field with strtotime validation, and I increased the granularity to include seconds.

I then wrote a SQL query to update the CCK.date_value field with the node.created field. This seemed to work fine. I now had identical 9 or 10 digit unix time stamps in the new date field of 500+ cck nodes. I also updated the field_date_timezone to GMT as not all nodes were so populated.

At this point, although I'm a rank amateur, I fully expected that when I went to edit one of the CCK nodes, that the widget would be populated with the created date, and not the current date and time? I tried using 5.x-1.6 and got the same result.

Have I committed a major blunder, or is there someway that the widget knows it didn't personally write the date and hence rejects my efforts to populate it's date field via a query?

Thanks very much if you can help!

Comments

herb’s picture

I think I surrender. The date widget is far smarter than I am.
I just started over and added a new date field as described above.
I edited node A and saved it with a new date. From now on it appears nicely on node A.
Then, using phpMyAdmin, I copied the cck_date_value field from node A into the same field in node B.
When I view node B, no date is displayed? When I edit node B, the widget ignores my manual data entry, and suggests I use the current date and time.
If anyone can suggest how this might be happening and/or where to look next it would be greatly appreciated.

UPDATE:
I edit Node A, B, and C with different dates. All works as expected, and 3 different numbers populate the cck_date_value field.
I then manually edit the cck_date_value_field so that they have the same number.
Going back to the pages, flushing the cache, the pages still have the original correct 3 different dates?!?!
Finally, I set the cck_date_field to 0, set it to NULL, empty the cache, and still the original correct dates are displayed? Ergo, the ckk_dates are stored somewhere else than the cck_date_value field - and I am totally confused..

herb’s picture

Status: Active » Closed (fixed)

OK - I think I got it.

In case anyone else has the same issue, I found the answer on http://drupal.org/node/133705 . You need to clear the CCK cache for each node. (The devel clear cache does not do this) - Write a little program to invoke cache_clear_all('content:'. $node->nid .':'. $node->vid, 'cache_content'); for the nodes to be updated. Then the cck date field can be updated with a SQL query. The next time the node is browsed, the ckk cache is updated, and the widget is forced to use the updated date field.