I receive this notice :
Notice: Trying to get property of non-object in profile2_page_own_title() (line 170 of .../sites/all/modules/profile2/contrib/profile2_page.module).
Only if I check Provide a separate page for editing profiles. (Possibly I think, it happens in the superadmin account who has no profile, because no profile is associated to his role, but I'm not sure of that, it's just a hint, if needed, if that's hard to reproduce.)
Here's the corresponding function:
function profile2_page_own_title($type_name) {
$type = profile2_get_types($type_name);
return user_is_logged_in() ? t('My @profile-label', array('@profile-label' => drupal_strtolower($type->label))) : check_plain($type->label);
}
Comments
Comment #1
Jerome F commentedIf I click on the profile link "My " (side note: the label is empty) I receive:
Fatal error: Call to a member function label() on a non-object in .../sites/all/modules/profile2/contrib/profile2_page.inc on line 28Comment #2
Jerome F commentedEDIT : removed - wrong debug hypothesis
Comment #3
Jerome F commentedIt appears, I have this bug because I use LM PayPal Subscriptions turned on and the profiles are associated with subscriptions and associated roles.
Comment #4
clashar commentedI got this error after updating to new dev versions of:
Ctools
Entity
Views
Relation
not sure which one could cause the error.
Comment #5
clashar commentednow all my former profile pages appear without profile names:
Before:
My jobseeker profile, My employer profile, My main profile
Now:
My, My, My
I tried latest profile2-7.x-1.0-beta4, but problem is still here.
Comment #6
clashar commentedComment #7
clashar commentedComment #8
Jerome F commented@clashar: There are 2 issues there, the one you refer to is described here : http://drupal.org/node/1210602
there's already a patch available provided by fago in http://drupal.org/node/1027908#comment-4610318 So I applied it.
Comment #9
clashar commentedJerome F, thanks for pointing the link.
Comment #10
clashar commentedactually I use latest Entity API version, where fago's patches as I understand are committed, but I got anyway these errors
Comment #11
LSU_JBob commentedI also get this, using drupal core 7.4, entity api 7.x-1.0-beta10 and profile2-7.x-1.0-beta4
SUPER EDIT: Clearing my cache made the error go away, upon further investigation the $type variable on line 170 was returning null, clearing cache forced the module to reload profile_types so $type was no longer null.
Comment #12
fagoPlease try to reproduce it with the latest module versions and re-open if still active.