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

Gravity Forms {pronamic_payment_id} is missing since update 7.0.0 #208

Closed
2 tasks done
remcotolsma opened this issue Sep 9, 2021 · 4 comments
Closed
2 tasks done
Labels
bug plugin: gravityforms Label for Gravity Forms related content.
Milestone

Comments

@remcotolsma
Copy link
Member

remcotolsma commented Sep 9, 2021

Internal HelpScout tickets:

@remcotolsma remcotolsma added bug plugin: gravityforms Label for Gravity Forms related content. labels Sep 9, 2021
@rvdsteege
Copy link
Member

Issue resolved in pronamic/wp-pronamic-pay-gravityforms@e2b8579

@remcotolsma remcotolsma added this to the 7.0.1 milestone Sep 9, 2021
@remcotolsma
Copy link
Member Author

remcotolsma commented Sep 9, 2021

@rvdsteege You mentioned that sometimes there were 2 meta values for the pronamic_payment_id meta key? Should we figure out how this happens? According to https://docs.gravityforms.com/gform_update_meta/ this should not happen? It is nice to know why the empty check is necessary.

@remcotolsma remcotolsma reopened this Sep 9, 2021
@rvdsteege
Copy link
Member

@remcotolsma First time our update_entry_payment_meta() is called, the pronamic_payment_id entry meta got set to null in the database.

In a subsequent call to gform_update_meta(), the result of gform_get_meta() in https://github.com/wp-premium/gravityforms/blob/2.4.20/forms_model.php#L7750-L7751 will be false. Therefore the $meta_exists also results in false and a new meta item gets added.

Therefore, we either have to keep the empty() check (or update to null !== $payment_id check) or cast $payment->get_id() to a string. In case there is no payment ID yet, an empty string will be added as pronamic_payment_id meta. An empty string meta item updates correctly.

remcotolsma added a commit to pronamic/wp-pronamic-pay-gravityforms that referenced this issue Sep 10, 2021
@rvdsteege
Copy link
Member

Related issue: some merge tags also resulted in empty text in notification with the Form is submitted event, even though the data was stored correctly in the entry. This has been resolved in pronamic/wp-pronamic-pay-gravityforms@e293644.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug plugin: gravityforms Label for Gravity Forms related content.
Projects
None yet
Development

No branches or pull requests

2 participants