Activity Stream assigns the date and time of import to new feed items. When feed items are timestamped, AS should set the create date of new items to the original create date, or at least retain the original item's create date in a custom field.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | activitystream-bad_created_date-296601-5.patch | 989 bytes | eojthebrave |
| #3 | activitystream-bad_created_date-296601-3.patch | 943 bytes | eojthebrave |
Comments
Comment #1
akalsey commentedActivity Stream already works this way. If an item is timestamped, the timestamp of the feed (or API result) is used. If no timestamp is present, the time of import is used. _activitystream_save() does this...
Comment #2
samc commentedActually I can verify that this is not in fact working and is a bug in both Beta 1 and dev.
The source of the bug is the call to node_object_prepare() which overwrites the timestamp of the activity with the time the node is saved. The setting of the node options and uid are redundant as well.
Commenting out this line in Beta 1 fixes the timestamp problem and doesn't appear to have any ill effects.
Perhaps the module should simply invoke 'prepare' on the node?
Comment #3
eojthebraveI can confirm that this is an issue. The attached patch fixes it by assigning the $node->created date to the $activity['timestamp'] after the call to node_object_prepare() rather than before.
Comment #4
swe3tdave commentedYou have to do something similar for the user->uid as well.. Or your going to get Anonymous (or the name of a logged user) instead of the feed's user...
Comment #5
eojthebraveHere's a patch that fixes the UID issue as well. Thanks for pointing that out.
Comment #6
akalsey commentedThe only reason that node_object_prepare was being called was to set the default publishing options for the content type and to run the prepare hook in case other modules are using it.
I'd already moved a number of the publishing options into the module specifically. The only remaining one was revisions. So I've moved that into the module too. And I've added the prepare hook calls directly in the save routine. This means that we don't need to call node_object_prepare anymore.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #8
akalsey commentedI wonder if there's a way to prevent the bot from closing issues. I mark them as fixed after checking in the code, then move them to closed when they make it into a release.
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.