• Resolved kuphd1

    (@kuphd1)


    Just updated to PM Pro 1.8.13 and now I’m getting the following error:

    Warning: Creating default object from empty value in …\paid-memberships-pro\includes\profile.php on line 92

    It has to do with this line of code:

    $user->membership_level->enddate = strtotime( get_option( 'timezone_string' ), $user->membership_level->enddate );

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter kuphd1

    (@kuphd1)

    Sorry… this is on the user profile page on the front end. Should’ve included where I’m getting the error.

    Thread Starter kuphd1

    (@kuphd1)

    Darn… last thing. It’s being used in conjunction with the Theme My Login plugin.

    Thread Starter kuphd1

    (@kuphd1)

    Okay… maybe not last thing… LOL

    It looks like adding a conditional around the code above fixes it. So…

    $user->membership_level->enddate = strtotime( get_option( 'timezone_string' ), $user->membership_level->enddate );

    … would become…

    if($end_date) {
    $user->membership_level->enddate = strtotime( get_option( 'timezone_string' ), $user->membership_level->enddate );
    }

    It seems the error is occurring because the logged in user (in this case, my admin account) doesn’t have a membership attached to it. Thus… no “enddate”. But wrapping that conditional around it solves the issue.

    Plugin Author Andrew Lima

    (@andrewza)

    Hey @kuphd1,

    Thank you for your feedback, glad you managed to figure it out!

    I have added an issue to the github page of Paid Memberships Pro for you with a link to this forum so the Paid Memberships Pro development team may look into this and implement this bug fix.

    Thank you once again and happy holidays!

    Please would you mark this ticket as resolved when you get a moment. ??

    Plugin Author Andrew Lima

    (@andrewza)

    Here is the link to the Github issue, please feel free to add to it – https://github.com/strangerstudios/paid-memberships-pro/issues/415

    Thread Starter kuphd1

    (@kuphd1)

    Hi @andrewza,

    Thanks much and happy holidays to you as well. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Warning: Creating default object from empty value’ is closed to new replies.