Loading multiple profile type gives a warning due to it trying to merge an array and a string set to 'FALSE'.

FIX:
file: profile2.module
function:
profile2_load_by_user

Original with bug

$profiles = profile2_load_multiple(FALSE, array('uid' => $uid));

Fixed

$profiles = profile2_load_multiple(array(), array('uid' => $uid));

By replacing the FALSE with an empty array() everything seems to works great!

Comments

DrCord’s picture

Issue summary: View changes
mrdalesmith’s picture

I've had this issue on a site, andit was a symptom of https://www.drupal.org/node/1549224: your user may have two profiles of the same kind, and so when profile2_load_multiple tries to load them, it messes up the return value in a way the code isn't written to handle.

If that's the case, the solution is to find the duplicate profile and delete it from the database, until the related issue is resolved.

mrdalesmith’s picture

I've had this issue on a site, andit was a symptom of https://www.drupal.org/node/1549224: your user may have two profiles of the same kind, and so when profile2_load_multiple tries to load them, it messes up the return value in a way the code isn't written to handle.

If that's the case, the solution is to find the duplicate profile and delete it from the database, until the related issue is resolved.

m23reo32’s picture

The suggested solution did not work for me. Traced and it happens when either cache or profiles variable is empty, so merging an empty cache with the profile variable resulted to the error.

I had made a work around for the meantime. Will be waiting for an update of it before I remove my modifications.

Thanks.

alex.bukach’s picture

I confirm, in my case the issue is caused by the fact that a user has multiple profiles of the same type.

alex.bukach’s picture

Status: Active » Closed (duplicate)