I installed this module last week. Almost every day I see one or more entries in the watchdog:
Notice: Undefined index: url in socialmedia_facebook_tokens() (line 142 of /xxx/sites/all/modules/socialmedia/socialmedia.platforms.inc).

I only enabled Twitter and RSS in the platforms. So facebook shouldn't be triggered at all.

I think the problem is in socialmedia_socialmedia_platform_info() where all info is gathered, but in there is no check if the info is used / no check if the platform is enabled.

Comments

willbxl’s picture

I have the same issue. I saw one time this:

• Notice: Undefined index: url in socialmedia_facebook_tokens() (line 142 of /home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: username in socialmedia_facebook_tokens() (line 146 of/home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: username in socialmedia_facebook_tokens() (line 146 of/home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: url in socialmedia_googleplus_tokens() (line 279 of /home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: username in socialmedia_googleplus_tokens() (line 283 of/home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: username in socialmedia_googleplus_tokens() (line 283 of/home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: url in socialmedia_linkedin_tokens() (line 349 of /home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: username in socialmedia_linkedin_tokens() (line 353 of/home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: username in socialmedia_linkedin_tokens() (line 353 of/home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: url in socialmedia_pinterest_tokens() (line 420 of /home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: username in socialmedia_pinterest_tokens() (line 424 of/home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: username in socialmedia_pinterest_tokens() (line 424 of/home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: url in socialmedia_youtube_tokens() (line 750 of /home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: username in socialmedia_youtube_tokens() (line 754 of/home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).
• Notice: Undefined index: username in socialmedia_youtube_tokens() (line 754 of/home/xxx/public_html/sites/all/modules/socialmedia/socialmedia.platforms.inc).

I've just set up my twitter account. I've no solution for the moment.

Structura’s picture

Same here:

•Notice: Undefined index: url in socialmedia_facebook_tokens() (line 142 of /var/www/www.xxxxx.com/www/sites/all/modules/socialmedia/socialmedia.platforms.inc).
•Notice: Undefined index: url in socialmedia_facebook_tokens() (line 142 of /var/www/www.xxxxx.com/www/sites/all/modules/socialmedia/socialmedia.platforms.inc).

But I've got them to disapear, when adding my Facebook profile under admin user and Social Profiles.

kai.stampe@gmail.com’s picture

Same Problem in my case, i enabled Twitter, FB and Google then i typed a link on Google option and got the Error on Twitter and FB. So i think it is caused by an empty array ( there cant be returned a username if there is no username given ). I try to solve it ... can anyone help??

Zen00’s picture

If you're bored with seeing this error, you can add a conditional if around whatever section you're having issues with, in my case for Facebook...

if ($profile === null) {
return;
}else{
return 'http://' . $profile['url'];
}

davidneedham’s picture

I'm seeing this error, but only when used on user profiles.

fchandler’s picture

I got rid of the message, thus far, by going into the database and removing profiles that were not being used.

In testing the module, I had set my facebook profile into admin/config/media/socialmedia/profiles. I later removed the profile, and turned off Facebook under Platforms at admin/config/media/socialmedia. That is when the error started. I had also set up user profiles, but later turned that off (no change in error message). So I went into the database Server: localhost »Database: che1307408523617 »Table: socialmedia_profile (Stores social media profile data) and deleted the table for Facebook, and the user data, listed by uid, 0 being the site. That got rid of the message.

I checked another dev site, on which I had tried to use social media, but did not have the profiles set. Filling the profiles in stopped the error on that site. That database had entries in the table for the profiles, but in the data column the information was incomplete e.g. a:1:{s:6:"inputs";a:2:{s:3:"url";s:0:"";s:8:"username";s:0:"";}} instead of a:3:{s:3:"url";s:34:"www.facebook.com/profilename";s:8:"username";s:17:"profilename";s:6:"inputs";a:2:{s:3:"url";s:42:"https://www.facebook.com/profilename";s:8:"username";s:0:"";}}.

Hope this helps someone.