I was trying to change the machine name of one of my profiles and got the below error.

Notice: Trying to get property of non-object in profile2_regpath_attach_profile_fields()

pointing to line 49

I inspected the database and noticed I still had an entry for my original machine name in profile2_regpath. I reverted my changes to the machine name and deleted the new entry and the error went away.

Obviously not a fix but it got my site error free in case anyone is wondering how.

I believe I am using the 7.2.x branch as I have profile registration blocks (awesome btw) additionally I have applied the patch for multiple profiles. https://drupal.org/node/2065847

Comments

ssoulless’s picture

Same problem here, after change the name of an existing profile I get that error

RvaAbdel’s picture

Same issue here. Thanks to GotYourGuy for his suggestion. Clearing rows in the table profile2_regpath solved the issue.

oksana-c’s picture

Same error "Notice: Trying to get property of non-object in profile2_regpath_attach_profile_fields() line 49" appears on user registration form if profile2 had machine name changed.

Thanks to GotYourGuy for the tip.