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

adrinux drupal-devel at drupal.org
Mon Jul 18 15:17:23 UTC 2005


Issue status update for 
http://drupal.org/node/24002
Post a follow up: 
http://drupal.org/project/comments/add/24002

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

I made a version of this patch for CVS HEAD:
http://drupal.org/node/26960




adrinux



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

1117558642 : 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.




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

1120093148 : 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*.




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

1120095771 : clydefrog

dtan, your patch contains html.




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

1120102803 : dtan

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

another one :)




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

1120144437 : 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.




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

1120159369 : mfb

+1




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

1120203070 : adrinux

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 :)




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

1121698888 : adrinux

Had time to test dtan's patch properly and can now say definitively that
it does fix this problem.


That is, without this patch the node created timestamp changes on a
node edit. With this patch applied only the node changed timestamp
changes, as you'd expect.


So +1 on this getting applied ASAP.







More information about the drupal-devel mailing list