Closed (fixed)
Project:
Delicious
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
3 Oct 2005 at 21:30 UTC
Updated:
22 Oct 2005 at 14:45 UTC
I had the old delicious plugin (4.2??) and it all worked just about.
Downloaded the 4.6.0 one, removed my old module (modules/delicious/*) and installed all the new files. Then added the mysql file to the database. Then set it all up by configuring at administer->settings->delicious with all node types, added a delicious block with user "willwade" and set the number to 20. Lastly enabled it in my account.
Tried firing it off with the cron script but alas nothing. zip. nowt. No errors or warnings just "Cron run completed" in the logs.
see the output (or lack of it) at: http://sourceymonkey.com/delicious
any help much much appreciated!!
thanks!
will
Comments
Comment #1
merlinofchaos commentedTry using mysql to execute this query and tell me the result:
select user, lastupdate, lastcode from delicious_user;
Comment #2
willwade commentedrunning "SELECT user, lastupdate, lastcode
FROM delicious_user" I get one row returned..
user: willwade
lastupdate:
lastcode: 0
by the way my cron script is stuck into cron to run every 10 minutes - not sure if that matters..
thanks
will
Comment #3
breyten commentedI'm having the same problems. My cron job runs every 15 minutes.
Comment #4
willwade commentedOk I know where the problem is occuring.. why is another matter:
around line 241 of delicious.module:
it never executes that line properly - or at least it does and it always returns nothing..
if you change it to (this is brutal hacking - I cant work out drupals logic..)
the _delicious_update_user($u) does get executed but of course it errors out in that function because it is expecting the object rather than the array..
what to do from here is where I got lost.. back to you mr merlinofchaos :)
debugging is a nightmare in drupal isnt it??!
hth
w
Comment #5
merlinofchaos commentedWow, that's interesting. And very, very weird. I've never seen db_fetch_object fail. And I've never gotten a failure like that.
Sorry I haven't worked on this this week; I've had a nasty cold and haven't had the brain power left to look at this.
Since I can't duplicate that on my system, try this:
Comment out the entirety of the while loop for now (but leave the db_query() statement), and in its place, do this:
$u = db_fetch_object($result);
print "
" . var_export($u, true) . "";Then browse your cron.php page and see what the output is. If it gives you any output at all, stick it back in the while loop, but do the debug printing instead of the _delicious_update_user call.
Comment #6
merlinofchaos commentedOops, forgot to code-tag it.
Err. Rather this
";
Comment #7
willwade commentedNo probs on not working on it - funnily enough the reason why Im looking at it this afternoon is because I have a cold..(and can't stand to think of the work I am meant to be doing..!!)
outputs as expected:
pass of course starred out. That would be just plain silly :)
I had a thought - is it because there is only 1 row returned?? I wouldn't of thought so..
Comment #8
merlinofchaos commentedIt shouldn't be just because there's one record; I only had one record in my system when testing that.
Do you get the same output within the while loop?
Comment #9
willwade commented... and I meant to say..
it all works in the loop..
looking further is being called
where it is erroring out is around 655
and it prints:
0 eh?? mean anything to you?
Comment #10
merlinofchaos commentedAt the point where it's printing cheeeeese, gromit print a var_export on $resp.
This is one that I have seen on other systems from time to time (but strangely rarely my own), and I think I may not be catching information out of the response. This could be valuable.
Also, when we're done here, you'd best change your password =)
Comment #11
willwade commentedim replying to quick:
chheeeeese wallace! the resp code is 200
chheeeeese grommit! the resp code is 0
so although it was 200 its getting changed to 0
commenting out
allows the cron to continue. yay.
Intrestingly (and perhaps this should be logged as a new bug) I get a mysql error
so 1 down, 1 new one to go...
:)
w
Comment #12
willwade commented(im such a muppet re: pass)
this fixes it by the way:
of course the other bug is nothing major - the script carries on as normal..
good teamwork :)
w
Comment #13
merlinofchaos commentedIf the other error happens again, open a new bug on it anyway. IF you can't duplicate it, er, don't bother.
The actual fix is to use intval() -- the reason that line of code was there was in case the response code is non-int, it caused the update to fail. I should've done that in the first place but I must've been sleeping.
Committing to HEAD.
Comment #14
merlinofchaos commentedCommited to HEAD (and changing status to fixed)
Comment #15
merlinofchaos commentedChanged the title to be something more informative for history and search purposes.
Comment #16
merlinofchaos commentedRecreating info because the project disappeared for a few moments, and this was followed up on and lost the project info.
Comment #17
(not verified) commented