Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes an error on the confirmation page #85

Closed

Conversation

JarrydLong
Copy link
Contributor

Once you've reached the confrmation page an error is thrown:

Warning: Attempt to read property "name" on string in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-pay-by-check\pmpro-pay-by-check.php on line 663

This references the membership level name.

We currently reference the user -> membership level but this hasn't been assigned yet because the order is still pending.

Instead, we've opted to reference the invoice -> membership level.

Once you've reached the confrmation page an error is thrown:

Warning: Attempt to read property "name" on string in C:\Users\info\Local Sites\paid-memberships-pro\app\public\wp-content\plugins\pmpro-pay-by-check\pmpro-pay-by-check.php on line 663

This references the membership level name.

We currently reference the user -> membership level but this hasn't been assigned yet because the order is still pending.

Instead, we've opted to reference the invoice -> membership level.
@michaelbeil
Copy link
Contributor

This came up in ticket 477489, so I sent the PR.

@michaelbeil
Copy link
Contributor

A customer (ticket 482012) is dealing with this.

@michaelbeil
Copy link
Contributor

michaelbeil commented Jun 20, 2023

A customer (ticket 482012) ran into this, so I added a PR with their changes.

They added a call to pmpro_getSpecificMembershipLevelForUser() after getting the user since the next line if ( ! empty( $user->membership_level->confirmation ) ) { will always be false, because $user->membership_level is not set. $invoice->membership_level does not contain the custom confirmation message, so the custom confirmation message will never be shown. I also changed $invoice to $user.

This pr #85 could be merged and this pr can be closed as it preserves Jarryd's commit.

@dparker1005
Copy link
Member

Closing as this fix has already been merged in #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants