Open paynecodes opened 12 years ago
Hi jpdesigndev, thanks for reporting the problem; I hadn't run into this issue before. It's definitely a bug. If the curl call to get the Twitter feed failed, I was closing the curl connection before getting ahold of the curl error code. That's not going to work!
I'm testing the fix now. If you have time I'd appreciate your testing it as well before I check it in. Here's the updated code, starting with line 329 of twitterfeed_helper.php in the system/expressionengine/third_party/twitterfeed folder:
$result = curl_exec($curl);
// if the curl call failed, log the error and return
if ($result === FALSE)
{
$this->EE->TMPL->log_item('Twitterfeed module : cURL exec error : ' . curl_error($curl));
curl_close($curl); // close the curl connection *after* getting the error code
return FALSE;
}
// close the curl connection; there weren't any curl errors
curl_close($curl);
Weird, but I am not able to replicate the initial issue before implementing this code. Will do my best to make it back around to this, and try to replicate the issue itself.
That being said, the new code seems to work fine, but I can't be sure. Thanks for your help! Awesome!!
Just went through another short period of dev time without an internet connection. So far so good in my limited testing.
Great, thanks for testing the fix. This kind of thing is hard to test because it depends on experiencing a CURL error during the call to get information from Twitter. That's not going to happen very often.
It's working well for me too; if it's still working well in a week I'll post the change to Github. Thanks again for reporting the problem.
The following PHP errors are occurring with the Twitter Feed plugin installed on my local machine only when internet connectivity is disabled. Is this an indicator of what could happen if the script has trouble connecting to Twitter in a production environment?
A PHP Error was encountered
A PHP Error was encountered
A PHP Error was encountered
Fatal error: ob_start() [ref.outcontrol]: Cannot use output buffering in output buffering display handlers in ~/expressionengine/system//codeigniter/system/core/Exceptions.php on line 166