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 the webhook URL for WordPress #13

Closed
wants to merge 1 commit into from

Conversation

agileware-pengyi
Copy link

The callback URL generated by CRM_Utils_System::url is wrong. Here is a fix for WordPress.

Before

When using WordPress, the URL sent to webhook is [yoursite.com]/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Feventbrite%2Fwebhook.

After

The URL will be [yoursite.com]?page=CiviCRM&q=civicrm%2Feventbrite%2Fwebhook.

Comment

Apparently, CRM_Utils_System::url cannot generate a correct frontend URL for WordPress even if I set the frontend parameter to TRUE (I got [yoursite.com]/civicrm?page=CiviCRM&q=civicrm%2Feventbrite%2Fwebhook).

I don't think this the best solution, so feel free to improve it.

Agileware ref: CIVICRM-1278

twomice added a commit that referenced this pull request Aug 5, 2019
…ess.

Credit to github.com/agileware-pengyi for suggesting this fix
(reference #13)
@twomice
Copy link
Owner

twomice commented Aug 5, 2019

Apparently, CRM_Utils_System::url cannot generate a correct frontend URL for WordPress even if I set the frontend parameter to TRUE (I got [yoursite.com]/civicrm?page=CiviCRM&q=civicrm%2Feventbrite%2Fwebhook).

@agileware-pengyi Actually that URL will work fine. If you visit [yoursite.com]/civicrm?page=CiviCRM&q=civicrm%2Feventbrite%2Fwebhook in a browser where you're not signed into the site, you should see the message Bad data. Could not parse JSON., which means you've reached the webhook listener.

Would you mind trying #15 and let me know if it works for you?

@agileware-pengyi
Copy link
Author

@twomice I agree that the URL will work. I will test #15 later.

@twomice
Copy link
Owner

twomice commented Aug 15, 2019

Closing this on the assumption that #15 will supersede it.

@twomice twomice closed this Aug 15, 2019
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.

None yet

2 participants