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);
}
CommentFileSizeAuthor
#6 d7_Profile2_20110707.png51.46 KBclashar

Comments

Jerome F’s picture

If 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 28

Jerome F’s picture

EDIT : removed - wrong debug hypothesis

Jerome F’s picture

It appears, I have this bug because I use LM PayPal Subscriptions turned on and the profiles are associated with subscriptions and associated roles.

clashar’s picture

I got this error after updating to new dev versions of:
Ctools
Entity
Views
Relation

not sure which one could cause the error.

clashar’s picture

now 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.

clashar’s picture

StatusFileSize
new51.46 KB
clashar’s picture

Priority: Normal » Major
Jerome F’s picture

@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.

clashar’s picture

Jerome F, thanks for pointing the link.

clashar’s picture

actually I use latest Entity API version, where fago's patches as I understand are committed, but I got anyway these errors

LSU_JBob’s picture

I 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.

fago’s picture

Status: Active » Postponed (maintainer needs more info)

Please try to reproduce it with the latest module versions and re-open if still active.