{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/amp-wp/issues/1356","repository_url":"https://api.github.com/repos/Automattic/amp-wp","labels_url":"https://api.github.com/repos/Automattic/amp-wp/issues/1356/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/amp-wp/issues/1356/comments","events_url":"https://api.github.com/repos/Automattic/amp-wp/issues/1356/events","html_url":"https://github.com/Automattic/amp-wp/issues/1356","id":353991892,"node_id":"MDU6SXNzdWUzNTM5OTE4OTI=","number":1356,"title":" Error messages in AMP pages when using a Form","user":{"login":"dominointernet","id":5453016,"node_id":"MDQ6VXNlcjU0NTMwMTY=","avatar_url":"https://avatars2.githubusercontent.com/u/5453016?v=4","gravatar_id":"","url":"https://api.github.com/users/dominointernet","html_url":"https://github.com/dominointernet","followers_url":"https://api.github.com/users/dominointernet/followers","following_url":"https://api.github.com/users/dominointernet/following{/other_user}","gists_url":"https://api.github.com/users/dominointernet/gists{/gist_id}","starred_url":"https://api.github.com/users/dominointernet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominointernet/subscriptions","organizations_url":"https://api.github.com/users/dominointernet/orgs","repos_url":"https://api.github.com/users/dominointernet/repos","events_url":"https://api.github.com/users/dominointernet/events{/privacy}","received_events_url":"https://api.github.com/users/dominointernet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-25T07:32:54Z","updated_at":"2018-08-29T21:41:02Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nThe Form at the bottom of our web pages briefly displays a “Form sent successfully” message and then redirects users to a “Thanks” page. The form uses ContactForm7.\r\n\r\nUnfortunately, the AMP version of these same pages doesn’t do either one thing or the other: no succesful message and no redirection.\r\nWe noticed we don't get in the AMP pages the usual message on mandatory fields that are left empty by the user.\r\n\r\nAnd we found 2 error messages in our code (when we check the page in Developer mode in Chrome). See below.\r\n\r\nThe problem is that users don’t have any verification that their form was sent to us so they insist clicking on the Submission button several times, creating fustration on them and filling up our email foder with dozens of copies of the same forms.\r\n\r\nOriginal URL (CF7 works great here): https://dragutierrez.com/tratamientos/medicina-estetica/dermapen/\r\nAMP URL (where CF7 doesn't work): https://dragutierrez-com.cdn.ampproject.org/c/s/dragutierrez.com/tratamientos/medicina-estetica/dermapen/?amp\r\n\r\nThese are the error messages we get:\r\n- - - - - - - - - - - - - - - - - - - - - - - - \r\nPowered by AMP zap HTML – Version 1534444305877 https://dragutierrez-com.cdn.ampproject.org/c/s/dragutierrez.com/tratamientos/cirugia-plastica/ginecomastia/precio-de-la-ginecomastia/?amp\r\ndragutierrez-com.cdn.ampproject.org/:1 Failed to load https://dragutierrez.com/wp-admin/admin-ajax.php?action=ampcf7_submit_form&_wp_amp_action_xhr_converted=1&__amp_source_origin=https%3A%2F%2Fdragutierrez.com: The 'Access-Control-Allow-Origin' header contains the invalid value '*.ampproject.org'. Origin 'https://dragutierrez-com.cdn.ampproject.org' is therefore not allowed access. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.\r\nlog.js:187 Form submission failed: Error: XHR Failed fetching (https://dragutierrez.com/...): Failed to fetch ... log.js:187\r\n- - - - - - - - - - - - - - - - - - - - - - - - \r\n\r\nThat js.187 line says:\r\nfn.apply(this.win.console, messages);\r\n\r\nI'm not sure but I wonder if there could be an issue with the way your plugin deals with Ajax.\r\nAny help appreciated.\r\n\r\nNOTE: we've also tested a simpler scenario using WP default theme (twenty seventeen and deactivating CF7 Redirection plugin.\r\n\r\nThanks in advance,\r\n\r\nJose Delgado"},"comment":{"url":"https://api.github.com/repos/Automattic/amp-wp/issues/comments/417115416","html_url":"https://github.com/Automattic/amp-wp/issues/1356#issuecomment-417115416","issue_url":"https://api.github.com/repos/Automattic/amp-wp/issues/1356","id":417115416,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzExNTQxNg==","user":{"login":"dominointernet","id":5453016,"node_id":"MDQ6VXNlcjU0NTMwMTY=","avatar_url":"https://avatars2.githubusercontent.com/u/5453016?v=4","gravatar_id":"","url":"https://api.github.com/users/dominointernet","html_url":"https://github.com/dominointernet","followers_url":"https://api.github.com/users/dominointernet/followers","following_url":"https://api.github.com/users/dominointernet/following{/other_user}","gists_url":"https://api.github.com/users/dominointernet/gists{/gist_id}","starred_url":"https://api.github.com/users/dominointernet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominointernet/subscriptions","organizations_url":"https://api.github.com/users/dominointernet/orgs","repos_url":"https://api.github.com/users/dominointernet/repos","events_url":"https://api.github.com/users/dominointernet/events{/privacy}","received_events_url":"https://api.github.com/users/dominointernet/received_events","type":"User","site_admin":false},"created_at":"2018-08-29T21:41:02Z","updated_at":"2018-08-29T21:41:02Z","author_association":"NONE","body":"Do you mean our website header, I mean the one used by Wordpress?\r\nI just deleted what we had (a Facebook Pixel and Google Recaptcha) and added this instead:\r\n<!-- Header empty by Jose -->\r\n\r\nSo refresh and test now please.\r\n(Make sure the page has loaded that new and almost empty header before you test it of course)\r\n"}}
{"actor":{"display_login":"dominointernet"}}