Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Form doesn't send data. No error shown

form

Solved by 01K View solution

Started by 01K 5 years ago · 7 replies · 524 views
5 years ago

Hi!
I've faced a strange problem with the contact form.
I had two technically identical websites, so the first one still works OK and the second encountered a problem.
Its contact form doesn't send data. Once submit button is pressed the loader is displayed, while it has to refresh and show a success message.
Either there is no any debug data.
Website is running live

My contact.lt.md have this truncated data:

YAML
---
title: 'Fill it'
media_order: bw.jpg
smallTitle: Contacts
menu: kontaktai
visible: true
cache_enable: false
opacity: '0'
phoneTitle: Phone
phoneMobile: ''
emailTitle: 'El. paštas'
emailAddress: email
addressDetails: 'address'
form:
    name: kontaktu-forma
    template: form-messages
    refresh_prevention: true
    fields:
        -
            name: email
            label: false
            placeholder: '@'
            type: email
            outerclasses: form-field
            classes: full-width
        -
            name: my-file
            label: 'Upload photos'
            type: file
            multiple: true
            limit: 5
            filesize: 6
            destination: user/data/files
            accept:
                - application/pdf
                - application/x-pdf
                - 'image/*'
        -
            name: space
            label: Plotas
            autofocus: 'off'
            autocomplete: 'on'
            type: select
            options:
                '': Kita
                300: 300m²
            validate:
                required: true
        -
            name: telephone
            label: Telefonas
            placeholder: Telefonas
            type: tel
            validate:
                required: true
        -
            name: message
            label: false
            placeholder: 'placeholder'
            type: textarea
            outerclasses: form-field
            classes: full-width
            rows: null
    buttons:
        -
            type: submit
            value: Submit
            outerclasses: form-field
            classes: 'full-width btn--primary'
    process:
        -
            email:
                from:
                    - '{{ form.value.email|e }}'
                to:
                    - '{{ config.plugins.email.to }}'
                subject: '[Message from] {{ form.value.name|e }}'
                body: '{% include ''forms/data.html.twig'' %}'
                attachments:
                    - my-file
        -
            message: 'Thanks message'
metadata:
    'og:url': 'https://asfaltavimas.eu/home/_contact'
    'og:type': website
    'og:title': 'Title'
    'og:image': 'https://asfaltavimas.eu/home/_contact/frezuotas-asfaltas-bw.jpg'
    'og:image:type': image/jpeg
    'og:image:width': '1800'
    'og:image:height': '1201'
    'og:author': author.eu
aura:
    metadata: {  }
    pagetype: website
    image: frezuotas-asfaltas-bw.jpg
---

Some text

Grav 1.7.2.3
Form Plugin v. 5.1.2 with filled recaptcha keys
image|690x277

So, I don't have any thoughts what could case this problem...

5 years ago

Try checking server logs. I see form is being submitted correctly
image|662x422

I suspect your email plugin might be misbehaving.

5 years ago

Before your message logs were clear.
Now that what I have:

TXT
||Mon Oct 25 13:53:45.318672 2021] [:error] [pid 24273:tid 140712624408320] [client 18.194.87.225:49572] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaMuUnCU7QHKt@jWSNlQwADSgM], referer: https://asfaltavimas.eu/|
|---|---|
||[Mon Oct 25 13:53:45.509763 2021] [:error] [pid 24133:tid 140712645388032] [client 18.194.87.225:49575] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaMuYd2yQ4E65N1N9e-RgACCAU], referer: https://asfaltavimas.eu/|
||[Mon Oct 25 14:00:13.788106 2021] [:error] [pid 24211:tid 140712676857600] [client 18.194.87.225:49648] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaOPdxSaXums-iO6xlaPwACiwg], referer: https://asfaltavimas.eu/|
||[Mon Oct 25 14:00:13.991745 2021] [:error] [pid 24539:tid 140712624408320] [client 18.194.87.225:49649] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaOPcWyNoKh9RdeiVlr1wAFhAM], referer: https://asfaltavimas.eu/|
||[Mon Oct 25 14:01:33.645019 2021] [:error] [pid 24466:tid 140712603428608] [client 18.194.87.225:49967] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaOjelTItQmaCZ5rOlzqwAFCgE], referer: https://asfaltavimas.eu/|
||[Mon Oct 25 14:01:33.850573 2021] [:error] [pid 24133:tid 140712687347456] [client 18.194.87.225:49970] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaOjYd2yQ4E65N1N9fCPwACDwk], referer: https://asfaltavimas.eu/|
||[Mon Oct 25 14:02:07.231157 2021] [:error] [pid 24003:tid 140712634898176] [client 18.194.87.225:50104] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaOr5BgGtzIBVJIJM@btAABAwQ], referer: https://asfaltavimas.eu/|
||[Mon Oct 25 14:02:07.421259 2021] [:error] [pid 24133:tid 140712645388032] [client 18.194.87.225:50109] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaOr4d2yQ4E65N1N9fChgACDAU], referer: https://asfaltavimas.eu/|
||[Mon Oct 25 14:02:40.829759 2021] [:error] [pid 24133:tid 140712687347456] [client 18.194.87.225:50244] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaO0Id2yQ4E65N1N9fCxQACDQk], referer: https://asfaltavimas.eu/|
||[Mon Oct 25 14:02:41.021396 2021] [:error] [pid 24133:tid 140712687347456] [client 18.194.87.225:50249] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaO0Yd2yQ4E65N1N9fCxgACAwk], referer: https://asfaltavimas.eu/|
||[Mon Oct 25 14:03:40.388897 2021] [:error] [pid 24539:tid 140712687347456] [client 18.194.87.225:50493] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaPDMWyNoKh9RdeiVltBQAFjQk], referer: https://asfaltavimas.eu/|
||[Mon Oct 25 14:03:40.574508 2021] [:error] [pid 24466:tid 140712666367744] [client 18.194.87.225:50498] [client 18.194.87.225] ModSecurity: Access denied with connection close (phase 2). String match ://asfaltavimas.eu/undefined at TX:referer_undefined. [file /etc/httpd/conf/modsec/999_user_exclude.conf] [line 50] [id 999007] [msg Block undefined$] [hostname asfaltavimas.eu] [uri /undefined] [unique_id YXaPDOlTItQmaCZ5rOl1OQAFDAc], referer: https://asfaltavimas.eu/|

Don't know is it related to forms...

5 years ago

asfaltavimas.eu/undefined is requested on every page load - should try to find what causes the error (most likely comes from JS), but I don't think it's related. There are also 3 SVG files that return a 404 error - also should not be related.

5 years ago

@01K, The async submission of the form returns a success status and its return value seems to be the HTML of the home page. Then, the return value is being assigned to div with class message-success.

If the spinner is removed, the nested page becomes visible.

Not sure if this leads to the endless spinner, but it sure doesn't look right...

5 years ago

I've found what is causing the problem - it is AdvancedPageCache v3.1.0.
So, I've to add something into a 'Blacklist' or report a bug...

P.S. it seems that Blacklist won't work, as it's a onepage

last edited 10/25/21 by 01K
5 years ago

@01K A bit more feedback might be helpful if someone else tumbles over the same issue..

  • How did you found out that AdvancedPageCache was causing the issue?
  • In what way is AdvancedPageCache causing the issue?
  • I had two technically identical websites, so the first one still works OK and the second encountered a problem.

    If so, why does only one of them show the issue?

5 years ago Solution

Simply - I've turned it off and form is working 🙂

I had two technically identical websites, so the first one still works OK and the second encountered a problem.

My bad, the second website doesn't utilize AdvancedPageCache. That's the difference between them

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 104 18 hours ago
General · by pamtbaau, 23 hours ago
1 88 22 hours ago
General · by Andy Miller, 1 day ago
0 53 1 day ago
General · by Marcel, 12 months ago
6 381 5 days ago
General · by Duc , 6 days ago
3 69 6 days ago