I just started receiving an error message on my social media widget.
* Notice: Undefined property: stdClass::$data in _socialmedia_widgets_get_facebook_locales() (line 609 of C:\xampp\htdocs\drupal_test\sites\all\modules\socialmedia\socialmedia.widgets.inc).
* Notice: Trying to get property of non-object in _socialmedia_widgets_get_facebook_locales() (line 610 of C:\xampp\htdocs\drupal_test\sites\all\modules\socialmedia\socialmedia.widgets.inc).
* Warning: Invalid argument supplied for foreach() in _socialmedia_widgets_get_facebook_locales() (line 610 of C:\xampp\htdocs\drupal_test\sites\all\modules\socialmedia\socialmedia.widgets.inc).
Please let me know what further information I can provide to help resolve this.
I searched but did not see any reference to those errors anywhere.
Comment | File | Size | Author |
---|---|---|---|
#7 | socialmedia-facebook-locales-2031897-7.patch | 1.3 KB | larskleiner |
Comments
Comment #1
Delty CreditAttribution: Delty commentedSame...
Comment #2
seisunos CreditAttribution: seisunos commentedThis error occurs only when cache is cleared.
I solved this problem with the help of Devel Module. If you go to the code line typed in the message, you insert a Devel debug instruction (
dpm($result);
), under the request sentence ($result = drupal_http_request("https://www.facebook.com/translations/FacebookLocales.xml");
), and you clear the cache, you'll see the detailed error: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?Then, you can enable that extension in your php.ini (extension=php_openssl.dll).
Hope this helps.
Comment #3
alblez CreditAttribution: alblez commentedI have a similar error
Error opening socket ssl://www.facebook.com:443
but I believe take active openssl
my phpinfo():
this occurs in a development server, I hope that when I go to production not have problems
seisunos thanks for the tip to debug
Comment #4
eletomm CreditAttribution: eletomm commentedSorry to reopen this one..but I have this error and I have tried all step that I found on all issues...can anybody tell me how to solve the problem?
Comment #5
cserna CreditAttribution: cserna commentedHi!
Solution at #2 worked for me. Thanks!
Comment #6
kenorb CreditAttribution: kenorb commentedOpenSSL is present.
Affected line:
foreach ($xml->locale as $line) {
Context:
Testing:
Sometimes it can be related to transparent corporate proxy so some certificates needs to be imported, or firewall (which blocks Facebook).
But in this case, curl works, so it's something else.
So still code needs to implement some failing scenario when the host is not reachable.
Comment #7
larskleiner CreditAttribution: larskleiner commentedThe attached patch checks if there are no errors in the response from Facebook before trying to cache the locale. It won't fix any issues with the call to Facebook but it will suppress the
Undefined property
related notices and warnings.Comment #8
kenorb CreditAttribution: kenorb commentedComment #9
kyletaylored CreditAttribution: kyletaylored at LevelTen Interactive commentedThis was fixed in a recent issue.
#2556779: Facebook Locales XML feed broken
While just checking for the data works, I'm going to assume it isn't coming back. There was a JSON version on Github that I linked to to use that as well, so at least there is some sort of fallback available.