Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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".
Comment | File | Size | Author |
---|---|---|---|
#5 | http_request.patch.txt | 1007 bytes | andrewlevine |
Comments
Comment #1
andrewlevine CreditAttribution: andrewlevine commentedI 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?
Comment #2
ChrisKennedy CreditAttribution: ChrisKennedy commentedYeah 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.
Comment #3
andrewlevine CreditAttribution: andrewlevine commentedOK, 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?
Comment #4
drewish CreditAttribution: drewish commentedroll 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.
Comment #5
andrewlevine CreditAttribution: andrewlevine commentedI 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.
Comment #6
drewish CreditAttribution: drewish commentedby 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 ;)
Comment #7
andrewlevine CreditAttribution: andrewlevine commentedfair enough...so, can we get this patch committed?
Comment #8
drewish CreditAttribution: drewish commentedget er done.
Comment #9
andrewlevine CreditAttribution: andrewlevine commentedfixed http://drupal.org/cvs?commit=70157
Comment #10
(not verified) CreditAttribution: commented