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

Fix a confirmation page error #89

Closed

Conversation

michaelbeil
Copy link
Contributor

@michaelbeil michaelbeil commented Jun 27, 2023

devs to check out #85 (comment).

A customer ran into this, so I added 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 could be merged and #85 closed as it preserves jarryds commit.

JarrydLong and others added 4 commits January 27, 2023 13:46
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.
call to pmpro_getSpecificMembershipLevelForUser() after getting the user$user->membership_level since the next line - `if ( ! empty( $user->membership_level->confirmation ) ) {` will always be false, because `$user->membership_level `is not set. And `$invoice->membership_level` does not contain the custom confirmation message, so the custom confirmation message will never be shown.
A customer (ticket 482012) ran into this.
The invoice status which is variable is filled into the confirmation message with just $invoice->status
instead of something like __( $invoice->status, 'pmpro-pay-by-check' )
@michaelbeil michaelbeil changed the title set $user->membership_level Fixes a confirmation page error Jul 24, 2023
@michaelbeil michaelbeil changed the title Fixes a confirmation page error Fix a confirmation page error Jul 24, 2023
@dparker1005
Copy link
Member

Closing as a fix for this issue was already implemented in #80

@michaelbeil michaelbeil deleted the error-on-confirmation branch August 11, 2023 17:31
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