What kinds of updates do we want to end up setting this field?
Obviously user edits to the doctext (for types including document). IMO changes to the title should also set it, as should changes to fields of non-document types (e.g. snippets). I'd also want Q&AEditor/SDC/janitor/pedagogue changes to set it. I don't care one way or the other whether hitting "Update" without having changed anything updates it. The field should probably be set the same as createtime at node creation (currently, lastedit often varies from createtime by one or more seconds because node and document are updated separately), not zero. Any other updates should IMO not set the field.
Implementation notes (some of which depend on things I say above that others may disagree with):
Having the lastedit field in document doesn't work for non-document types, or for having it match createtime, so it should move to node. I'd make it a datetime field, instead of a timestamp, since we don't want the magic autoupdate behaviour that timestamps have (though I think that only happens with the first timestamp field in the table). Also note that apparently timestamps are changed to return by default as strings as of MySQL 4.1. When the new node.lastedit field is added, it should be set the same as createtime.
Then the following changes should be enough:
Everything/NodeBase.pm (insertNode): add -lastedit => "now()"
Everything/HTML.pm (gotoNode) and handle_node_edits: fetch now() and set $NODE->{lastedit} to it before calling updateNode
In reply to maintaining a time of last edit for nodes by ysth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |