Topic-icon Errors when signing up

Active Subscriptions:

None
11 years 6 months ago #49539 by ozclubbers
Hi,

My users, when they are attempting to sign up using their Facebook details, are getting the following errors:

"Warning: Invalid argument supplied for foreach() in /home/snip/components/com_jfbconnect/libraries/profile/facebook.php on line 290

Warning: Invalid argument supplied for foreach() in /home/snip/components/com_jfbconnect/libraries/profile/facebook.php on line 290

Warning: Invalid argument supplied for foreach() in /home/snip/components/com_jfbconnect/libraries/profile/facebook.php on line 290

Warning: Cannot modify header information - headers already sent by (output started at /home/snip/components/com_jfbconnect/libraries/profile/facebook.php:290) in /home/snip/components/com_jfbconnect/libraries/provider/facebook.php on line 299"

and

"Warning: Cannot modify header information - headers already sent by (output started at /home/snip/components/com_jfbconnect/libraries/profile/facebook.php:290) in /home/snip/components/com_community/libraries/core.php on line 534"

(I've snipped the paths just for security and string length purposes)

I am using the Jomsocial registration component, not the JFBConnect one. When these errors are experienced, none of the extra data is populated into the fields from their facebook account.

Can you please assist?

Thanks
Adam
The topic has been locked.
Support Specialist
11 years 6 months ago #49543 by alzander
Replied by alzander on topic Errors when signing up
We'll have to look at why those warnings are being created. However, they are just PHP Warnings which are not real 'error's. On any production site, we recommend setting the Global Configuration setting for "Error Reporting" to "None" which will hide those messages and fix the problem.

I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 6 months ago #49544 by ozclubbers
Replied by ozclubbers on topic Errors when signing up
Hi Alex,

Thanks for investigating. I normally would have the error reporting set to "None", but when i noticed that the information was not being passed through from facebook to the registration, i changed it to Simple to see if anything was happening.

Look forward to hearing back from you what you suspect it is

Thanks
Adam
The topic has been locked.
Support Specialist
11 years 6 months ago #49555 by mel
Replied by mel on topic Errors when signing up
The first warnings would probably be the ones that would be causing problems with fields not being imported correctly. I was able to narrow down and reproduce the problem to being when the user does not have any education information set up in their Facebook account.

In your /home/snip/components/com_jfbconnect/libraries/profile/facebook.php around line 289, can you replace
$edu = $this->data->education;
foreach ($edu as $k => $node)
{
   if ($node->type == $parts[1])
   {
      unset($parts[0]);
      unset($parts[1]);
      $newPath = 'education.' . $k . '.' . implode('.', $parts);
      $data = parent::get($newPath, $default);
      break;
   }
}
with
$edu = $this->data->education;
if($edu)
{
   foreach ($edu as $k => $node)
   {
      if ($node->type == $parts[1])
      {
         unset($parts[0]);
         unset($parts[1]);
         $newPath = 'education.' . $k . '.' . implode('.', $parts);
         $data = parent::get($newPath, $default);
         break;
      }
   }
}

Could you try the following code change and see if you encounter the problem anymore?

Warning: Cannot modify header information - headers already sent by (output started at /home/snip/components/com_jfbconnect/libraries/profile/facebook.php:290) in /home/snip/components/com_jfbconnect/libraries/provider/facebook.php on line 299"

and

"Warning: Cannot modify header information - headers already sent by (output started at /home/snip/components/com_jfbconnect/libraries/profile/facebook.php:290) in /home/snip/components/com_community/libraries/core.php on line 534"

We have seen this error before, but they don't seem to affect anything from functioning for us. If you're still having trouble after the above code change let us know. Otherwise, I think turning off the warnings would be fine for this second set of errors.

-Melissa
The topic has been locked.