[drupal-devel] [bug] node created timestamp changes on node edit

adrinux drupal-devel at drupal.org
Fri Jul 1 07:31:15 UTC 2005


Issue status update for http://drupal.org/node/24002

-Project:      Image
+Project:      Drupal
-Version:      4.6.0
+Version:      4.6.0
-Component:    image.module
+Component:    node.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  adrinux
 Updated by:   adrinux
 Status:       patch

No time to test this until next week myself, but It's already got two
+'s so I'm moving it to core and re-titleing.
Thanks to dtan for hunting this one down :)




adrinux



Previous comments:
------------------------------------------------------------------------

May 31, 2005 - 17:57 : adrinux

When an image node is edited it changes position in the gallery, and in
image taxonomy listings. This is not the usual 'most recently edited'
item floating to the top. The edited image simply shifts to a different
place in the gallery with no apparent logic.


As far as I can tell this happens because image module sorts the images
in a gallery by the node creation timestamp, and for some reason the
creation timestamp is being incremented a little on editing the node.
(Of course the changed timestamp also changes as expected.)


Here's and example.
Lets take this gallery http://sphop.perlucida.com/image/tid/62


And change the title from *sphp_2002_061_henk.jpg* to *Seagulls* on
this image:
http://sphop.perlucida.com/node/322


Prior to the change we have the following (info extracted from the db):
nid: 322
title: sphp_2002_061_henk.jpg
created: 1117550744
changed: 1117550744


And the image is listed between *sphp_2002_062_henk.jpg* and
*sphp_2002_060_henk.jpg* as you'd expect.


We change the title and image moves to appear between
*sphp_2002_067_henk.jpg* and *sphp_2002_066_henk.jpg* as you can see:
http://sphop.perlucida.com/image/tid/62?from=12


The db now gives:
nid: 322
title: Seagulls
created: 1117550756
changed: 1117558316


So, why does the *created* timestamp change at all, and can I stop that
happening?


I should say that the images in the gallery were initially imported
using import_image.module - but I don't see what this could have to do
with that.




------------------------------------------------------------------------

June 30, 2005 - 01:59 : dtan

Attachment: http://drupal.org/files/issues/node.module.created.patch (591 bytes)

You'll notice that there is an authored on text box. . .it doesn't
provide seconds, so when the timestamp is created, it picks up the
current minutes seconds.   Thus if you edit a node (any type) and view
its created field in the db, and continuously repeat over 60 seconds,
you will see the created loop back down.  


Here is the patch. . .which is actually applied to the *node.module*.




------------------------------------------------------------------------

June 30, 2005 - 02:42 : clydefrog

dtan, your patch contains html.




------------------------------------------------------------------------

June 30, 2005 - 04:40 : dtan

Attachment: http://drupal.org/files/issues/node_module_created.patch (591 bytes)

another one :)




------------------------------------------------------------------------

June 30, 2005 - 16:13 : Jose A Reyero

Hey dtan, I'd say very good catch  :-) , tested the patch and seems to
be ok.


Anyway, I think this bugfix needs to be posted to Drupal core.




------------------------------------------------------------------------

June 30, 2005 - 20:22 : mfb

+1







More information about the drupal-devel mailing list