Im getting notices for
Notice: Undefined index: link in fb_user_form_user_profile_form_alter() (line 763 of /sites/all/modules/fb/fb_user.module).

Comments

scobee’s picture

After scouring the FaceBook Developers site for reference to the access tokens, I found that the 'link' token doesn't exist. It looks like it was replaced with 'id'. So...
I changed line 765 from
'!profile_page' => l($data['name'], $data['link'])));
to
'!profile_page' => l($data['name'], $data['id'])));

All seems to be working fine for me now.

jimsmith’s picture

I'm using current 7.x-3.x-dev version. Editing that line did not remove the error.

TikaL13’s picture

Having the same problem

hawkeye217’s picture

+1... same problem, latest -dev.

Prague man’s picture

Same problem, subs.

jaxpax’s picture

same here

jaxpax’s picture

I followed the advice from scobee and changed 'link' to 'id', and the problem got solved.

@scobee - Thanks a bunch!

yareckon’s picture

Could someone who has done this edit provide a git format patch for it if it is still needed? Thanks.

jaxpax’s picture

Hmmm, I'm not sure how to do any of that stuff. I'm not a coder so I haven't had any reasons to learn these things.

tpainton’s picture

Status: Active » Needs review
StatusFileSize
new933 bytes

I had same problem. The fix above worked. I am providing the following patch. This needs to be tested to make sure it doesn't cause other problems. This is for latest 7 Dev.

kpojeta’s picture

scobee - your switch worked for me - although in the latest dev release (today is 3/27/12 and I just updated) the line number is 784.

Dave Cohen’s picture

Status: Needs review » Needs work

I just tried but could not reproduce the problem.

Anyway assuming that for some users link is not returned, the patch is still no good. You've avoided a php warning but now have a broken link on the page.

$data[link] is a full url. In my test, i.e. http://www.facebook.com/someuser

$data[id] is number. It shouldn't be passed into l().

A proper patch would check for the existence of $data[link] and use it only if present.

Abdso’s picture

Hi, hello everybody. I am using drupal 7 and the last version of drupal for facebook. I have this problem but only when I try to edit an user account from my user account (admin account). I get this message:

Notice: Undefined index: link en fb_user_form_user_profile_form_alter() (línea 784 de /home/s12cff1b/public_html/modules/fb/fb_user.module).

The first time I installed drupal for facebook I didn't modify mi settings.php file and the result was the message appeared to users too (when an user account tried to modify its own account). I had other problems so I uninstalled all and installed again with the settings.php modified.

Now If I change "link" to "id" this message disappear but I'm not gonna do this because the message don't bother the users.

modctek’s picture

subscribing - getting this error and I'm worried about attempting the fix suggested because of points made by #12.

xurizaemon’s picture

StatusFileSize
new1.52 KB

I can reproduce this. Modified as per Dave's suggestion from #12, fixed a similar block in fb_test also.

xurizaemon’s picture

Status: Needs work » Needs review

Wish that I always remembered to update status when attaching patches. Oh look, #1365556: Auto-switch status to "need review" when attaching a patch.

fluffy’s picture

Patch at #15 worked for me.

Dave Cohen’s picture

Status: Needs review » Fixed

Thanks for patches and review. Pushed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.