I am trying to setup the flickr module but I keep getting an "Could not connect to Flickr, HTTP error".

While investigating, I saw that flickr.inc should display $result->error rather than $result->code on line 96. flickr_set_error(t("Could not connect to Flickr, HTTP error @error", array('@error' => $result->code))); . By changing this line I was able to get the actual error message, which is "110 Connection timed out".

CommentFileSizeAuthor
#5 http_request.patch.txt1007 bytesandrewlevine
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andrewlevine’s picture

I agree that we should be using $result->error instead of $result->code, but why is $result->code not working? It should have printed 'Could not connect to Flickr, HTTP error 110'... correct?

ChrisKennedy’s picture

Yeah I would have thought so too, but it didn't.

After some investigation, $result->code was only added to DRUPAL-5 six weeks ago: http://drupal.org/node/137138

So if you're using 5.0 or 5.1, rather than an updated CVS checkout, that variable won't be defined.

andrewlevine’s picture

OK, I took a look at CVS and now see why this wasn't working. 5.x always had the $result->code, but only in 5.1 was it updated to correctly take account of network/tcp errors. Connection timed out is one of those errors.

I think we should use $result->error instead to be compatible with 5.x but leave a comment saying for 6.x we may want to switch back to $result->code. How's that sound ChrisKennedy/drewish?

drewish’s picture

roll it back but leave a comment, explaining what should happen when 5.3 gets released. when we start updating for 6 we'll need to make a ton of changes so i wouldn't worry about that yet.

andrewlevine’s picture

Status: Active » Needs review
FileSize
1007 bytes

I was wrong, as of 5.1 this bug isn't fixed in Drupal. We will have to wait until the next release for that.

drewish: I'm not sure what you mean by roll back. Roll back to what? What I meant is that I think that we should support the fix for this bug for all versions of 5.x since people will be running <=5.1 for a while. Once we have a 6.x version, we can start using $result->code again.

Here is a patch for consideration.

drewish’s picture

by roll it back i meant get it working with the 5.1 code. once 5.2 is released we can use the new variable. drupal point releases are security related so everyone *should* be running the latest one. if they don't they'll have bigger problems than the flickr module not reporting error messages ;)

andrewlevine’s picture

if they don't they'll have bigger problems than the flickr module not reporting error messages ;)

fair enough...so, can we get this patch committed?

drewish’s picture

Status: Needs review » Reviewed & tested by the community

get er done.

andrewlevine’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)