Item dates not correct

rosslaird - May 1, 2008 - 14:19
Project:Activity Stream
Version:5.x-1.0-beta3
Component:Code
Category:bug report
Priority:normal
Assigned:akalsey
Status:closed
Description

Thanks for the module. Works great (basically), but I have one issue: my del.icio.us activity shows, but not my twitter activity. I have filled out both username fields properly, and I have manually run cron (as well as just leaving it for a while). Still no twitter.

Ross

#1

rosslaird - May 1, 2008 - 14:23

#2

Craig Gardner - May 1, 2008 - 18:46

Have you checked out the php logs? I would also re enter your twitter username just to make sure there are no spaces at the beginning or end of the username. I had the same problem and that fixed it for me.

I noticed that if a feed is not found SimplePie logs a message to the php log and not to watchdog (which it probably should).

#3

rosslaird - May 2, 2008 - 14:02

Thanks for the feedback. The log showed that the twitter feed was being correctly accessed, but here's what I was missing: in the log, many of the twitter entries are at the top of the list of entries, because most are more recent than the items from del.ici.us. But on the activity stream page, the twitter entries are shown at the end of the list (for some reason unknown to me). Since my list of recent del.icio.us links is longer than a page (actually it's three pages), the twitter entries do not show up until the third page. I wonder if there is a way to change this display order so that the activity stream shows newest-to-oldest rather than oldest-to-newest.

Anyway, I'm most of the way there. Again, thanks for the great module.

Ross

#4

Craig Gardner - May 2, 2008 - 18:21

Everything I've seen tells me that it should be displaying the activitystream entries from newest to oldest. I'm going to need more information for this tricky one.

Another thing to make sure the dates are showing up properly in the stream. See attachment for screenshot

AttachmentSize
ActivityStream.jpg 26.7 KB

#5

akalsey - May 2, 2008 - 18:38

cgardner is correct. Activity stream sorts the lists in reverse chronological order. The newest items should be shown first. Got a link I can look at to see your problem in action?

#6

rosslaird - May 2, 2008 - 23:07

Thanks for the assistance. Well, it does seem to be a date problem. My stream does not show the dates in the same way as the pic above. I have attached a pic of what I see (all dates show as December 31, 1969, 3:59pm). Also, here is my page:

http://rosslaird.info/stream/1

Ross

AttachmentSize
Screenshot-rosslaird's Activity Stream | Ross A. Laird - Mozilla Firefox 3 Beta 5.png 23.45 KB

#7

akalsey - May 2, 2008 - 23:56
Title:Twitter updates not displaying» Item dates not correct

I'm not sure what would cause this. The node date and time should be set to what's in the Twitter and Delicious feeds. Can you try adding the Flickr module in and see if it works? It doesn't use feeds, so if that works, we can at least isolate where the problem lies.

#8

rosslaird - May 3, 2008 - 01:50

OK, I went to flickr (which I don't use much), uploaded an image to my photostream, made it public, switched tabs to drupal, added the flickr plugin and api into the settings for the Activity Stream, ran cron for drupal, checked the log and the Activity Stream page -- and did not find a flickr update. As I don't use flickr much, perhaps I need to do more than upload a single image to get the Activity Stream to notice. But if what I've done is sufficient, it appears not to have had any effect.

By the way, I have the twitter badge on the main page of my site, and it shows the times and dates correctly.

#9

Craig Gardner - May 6, 2008 - 18:34

It seems that the created dates are either being cleared out or there's some weird data in it. Maybe try uninstalling the module, reinstall it, and run the cron again. It appears that it's displaying the unix timestamp for January 1, 1970 which in my experience is pretty much the default timestamp but your site is configured for the -600 time zone.

#10

rosslaird - May 6, 2008 - 22:58

When I deactivated and uninstalled the modules, removed the actual files from the modules/activitystream directory, re-downloaded the files and extracted them again, then re-installed the modules, here's what I got:

* user warning: Duplicate entry 'profile_activitystream_placeholder' for key 2 query: INSERT INTO profile_fields (title, name, explanation, category, type, weight, required, register, visibility, autocomplete, options, page) VALUES ('Placeholder', 'profile_activitystream_placeholder', 'Empty by design. This field simply holds the place so the activitystream category can be added to profiles by a module', 'Activity Stream', 'textfield', -10, 0, 0, 0, 0, null, null) in /home/.nantucket/rosslair/rosslaird.info/includes/database.mysql.inc on line 172.
* Table installation for the Activity Stream module was unsuccessful. The tables may need to be installed by hand. See the activitystream.install file for a list of the installation queries.

#11

rosslaird - May 7, 2008 - 01:53

I have checked the install file, and all seems to be in order. Even the date format of the database field looks right. The only thing I can't figure out (other than why this all happening in the first place) is why the phpmyadmin page says "No Index defined!". Here's a shot for reference:

Ross

AttachmentSize
screnshot.png 87.5 KB

#12

akalsey - May 7, 2008 - 02:16

I know where the problem lies. Will be fixed in the next release.

#13

rosslaird - May 7, 2008 - 02:43

Excellent. In the meantime, is there anything I can do to get this working a little better?...

#14

akalsey - May 7, 2008 - 03:05

It looks like it's a problem with how PHP 4 handles date strings. It's choking on the commas, as seen at http://seanreiser.com/node/956

The fix, as detailed there, is to find this line in activitystream_feed.module

<?php
$activity
['timestamp'] = strtotime($item->get_date());
?>

and change it to

<?php
$activity
['timestamp'] = strtotime(str_replace(',','',$item->get_date()));
?>

PHP 4 is considered obsolete and is no longer under development (not even critical bug fixes), so I'm not going to spend a lot of time testing and coding toward it. However, this is a small change that's not likely to cause problems with newer php releases, so I'll get this fix in.

#15

rosslaird - May 7, 2008 - 19:37

Yes! It works! Hurray!...

Thanks for hanging in there until this got resolved.
You know how sometimes, when you're working on something, and you know it's irrational to keep obsessing about it, to keep trying various things when none of them get you any closer to resolution, and you start to recognize that this is probably not a good thing to spend so much time on small and irrational pursuits that (very likely) no one, or almost no one, is really going to notice, but you keep plugging away, looking for illumination and clarity and that final, fulfilling moment when you click the button and the damn thing finally renders perfectly. You know how that goes? This was one of those...

Ross

#16

akalsey - May 16, 2008 - 15:24
Category:support request» bug report
Assigned to:Anonymous» akalsey
Status:active» fixed

#17

akalsey - May 16, 2008 - 23:05
Status:fixed» closed

The fix is in 1.0: http://drupal.org/node/259450

 
 

Drupal is a registered trademark of Dries Buytaert.