Closed (fixed)
Project:
Mailchimp
Version:
2.0.0
Component:
General
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
1 Nov 2019 at 07:50 UTC
Updated:
23 Feb 2021 at 02:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
grahlWhen adding the URL with the hash seen in the backend UI to Mailchimp the endpoint is added successfully. However, the Drupal backend always fails with "We couldn't verify the URL is working. Please double check and try again. HTTP Code: 403"
This presumably happens since the webhook url generated uses a different technique to generate a hash which the endpoint does not use.
The patch removes the unnecessary key generation function mailchimp_webhook_key(), removes the unused function mailchimp_process_webhook_access() using it as well and generates a proper link in mailchimp_webhook_url() with language prefixes present. Also some minor UI tweak to show that as well in the backend form.
Comment #3
jayelless commentedThanks @grahl. The patch in #2 has enabled me to activate the webhooks in my site. I am running 8.x-1.11.
Comment #4
playful commented#2 also works for me on 8.x-1.11.
Comment #5
kristofferromPatch not working for me unfortunaly. Getting:
Comment #6
anouar_dhawadi commentedHello,
Me also i encountered the same problem:
An error occurred adding webhook for list 22f416b5ce. "400: Invalid Resource - The resource submitted could not be validated. For field-specific details, see the 'errors' array. a:1:{i:0;O:8:"stdClass":2:{s:5:"field";s:3:"url";s:7:"message";s:88:"We couldn't verify the URL is working. Please double check and try again. HTTP Code: 403";}}"
Comment #7
brendanthinkshout commentedRerolling to apply @grahl's solution to the current code, but this still needs testing. @jlscott, @playful, can you offer a little more detail about which webhooks you were able to successfully activate? @kristofferrom, @anouar_dhawadi, what about you? Is it possible that the condition of a site having one or multiple languages active makes a difference here?
Comment #8
grahlIf they are part of the URL, yes it does, at least in terms of if the form in Drupal is showing a webhook as active or not. You can verify this by changing the language prefix in your path and see the value change. (You can also verify the hook being present in the other language or potentially multiple langauges in the Mailchimp backend.)
A pragmatic solution could be to enforce the default language in the webhook form since the hook isn't language dependent. That would avoid looking through all possible registered language-specific hook URLs.
Comment #9
brendanthinkshout commentedAha, something like this then?
Comment #10
brendanthinkshout commentedLet's try that with a patch that applies.
Comment #12
vladimirausLooks like test was failing due to global object.
Comment #14
vladimirausComment #15
gcbComment #16
gcbRe-rolled patch against 2.x branch, with improvements to translatability on the admin screen and making use of the `mailchimp_webhook_url` function for DRY/consistency.
Comment #17
gcbComment #19
gcb