Closed (duplicate)
Project:
Profile 2
Version:
7.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2014 at 18:09 UTC
Updated:
26 Dec 2016 at 06:56 UTC
Jump to comment: Most recent
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
Comment #1
DrCord commentedComment #2
mrdalesmith commentedI'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.
Comment #3
mrdalesmith commentedI'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.
Comment #4
m23reo32 commentedThe 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.
Comment #5
alex.bukach commentedI confirm, in my case the issue is caused by the fact that a user has multiple profiles of the same type.
Comment #6
alex.bukach commentedSee https://www.drupal.org/node/1549224.