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

Modular contact form not processing #1720

Closed
DimitriSteyaert opened this issue Oct 28, 2017 · 19 comments
Closed

Modular contact form not processing #1720

DimitriSteyaert opened this issue Oct 28, 2017 · 19 comments
Labels

Comments

@DimitriSteyaert
Copy link

DimitriSteyaert commented Oct 28, 2017

Hi,

I have followed the steps on https://learn.getgrav.org/forms/forms/how-to-forms-in-modular-pages to add a form to my modular website at https://steyaert.be/marleen/.
But when I fill out the form and click the send button ("Verzend") nothing happens. I'm not guided to the thankyou page, the maillogs on my server tell me that there is no mail sent.

I've set the Mail Engine to SMTP (changed it to PHP as a test), the default from and to are defined.
I enabled the debugger but also nothing there, just like there is nothing to see in logs/grav.log.

I also noticed that adding the form definition in modular.md doesn't show my form but adding the definition to form.md does show it.
I also tried to base this on the deliver theme where it does work if I test but still can't seem to pinpoint the issue.

You can download the entire source from https://steyaert.be/marleen.tgz if you'd like.

I hope you can guide me in the right direction so that I can solve this.

Cheers

@rhukster
Copy link
Member

I'll try to take a look at your source if i get a minute.

@DimitriSteyaert
Copy link
Author

Hi @rhukster , have you been able to take a look at this recently? :)

@DimitriSteyaert
Copy link
Author

Hi, did you happen to find anything yet? :)

@mahagr
Copy link
Member

mahagr commented Jan 18, 2018

Just a thought: Make sure you're not caching the page where the form is located. I remember having all kinds of issues if you cache pages with a form.

@DimitriSteyaert
Copy link
Author

Hi, I have disabled caching but this didn't help.

@mahagr
Copy link
Member

mahagr commented Feb 12, 2018

I found a bug which could be related to this issue. Though I'm not sure if it affects also modular pages.. But if you are adding content dynamically, it'll make form not to work.

@DimitriSteyaert
Copy link
Author

Hi, all content is loaded from the pages itself and nothing comes from external resources. But did you manage to fix this bug? Otherwise I could test this on my modular website.

@mahagr
Copy link
Member

mahagr commented Feb 14, 2018

Regarding to what you just said, I don't think my fix affects your issue. There's no tgz file anymore in the above url, so I cannot see what's going on.

@DimitriSteyaert
Copy link
Author

Oh yes, I had removed the tgz. I have put it back so you can download it again.

@DimitriSteyaert
Copy link
Author

DimitriSteyaert commented Feb 16, 2018

I have just updated the form plugin to v2.11.4 and now I get the following error when filling out the contact form:

[2018-02-16 08:36:16] grav.CRITICAL: Call to a member function post() on null - Trace: 
#0 [internal function]: Grav\Plugin\FormPlugin->onPageInitialized(Object(RocketTheme\Toolbox\Event\Event), 'onPageInitializ...', Object(RocketTheme\Toolbox\Event\EventDispatcher)) 
#1 /var/www/sites/steyaert.be/web02/sites/marleenlabbeke/vendor/symfony/event-dispatcher/EventDispatcher.php(184): call_user_func(Array, Object(RocketTheme\Toolbox\Event\Event), 'onPageInitializ...', Object(RocketTheme\Toolbox\Event\EventDispatcher)) 
#2 /var/www/sites/steyaert.be/web02/sites/marleenlabbeke/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'onPageInitializ...', Object(RocketTheme\Toolbox\Event\Event)) 
#3 /var/www/sites/steyaert.be/web02/sites/marleenlabbeke/vendor/rockettheme/toolbox/Event/src/EventDispatcher.php(23): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('onPageInitializ...', Object(RocketTheme\Toolbox\Event\Event))
#4 /var/www/sites/steyaert.be/web02/sites/marleenlabbeke/system/src/Grav/Common/Grav.php(288): RocketTheme\Toolbox\Event\EventDispatcher->dispatch('onPageInitializ...', Object(RocketTheme\Toolbox\Event\Event)) 
#5 /var/www/sites/steyaert.be/web02/sites/marleenlabbeke/system/src/Grav/Common/Processors/PagesProcessor.php(26): Grav\Common\Grav->fireEvent('onPageInitializ...', Object(RocketTheme\Toolbox\Event\Event)) 
#6 /var/www/sites/steyaert.be/web02/sites/marleenlabbeke/system/src/Grav/Common/Grav.php(132): Grav\Common\Processors\PagesProcessor->process() 
#7 /var/www/sites/steyaert.be/web02/sites/marleenlabbeke/system/src/Grav/Common/Grav.php(379): Grav\Common\Grav->Grav\Common\{closure}() 
#8 [internal function]: Grav\Common\Grav::Grav\Common\{closure}('pages', 'Pages', Object(Closure)) 
#9 /var/www/sites/steyaert.be/web02/sites/marleenlabbeke/system/src/Grav/Common/Grav.php(355): call_user_func_array(Object(Closure), Array) 
#10 /var/www/sites/steyaert.be/web02/sites/marleenlabbeke/system/src/Grav/Common/Grav.php(133): Grav\Common\Grav->__call('measureTime', Array) 
#11 /var/www/sites/steyaert.be/web02/sites/marleenlabbeke/index.php(52): Grav\Common\Grav->process() 
#12 {main} [] []

I updated the .tgz on https://steyaert.be/marleen.tgz.

@mahagr
Copy link
Member

mahagr commented Feb 16, 2018

Can you get the whole traceback for the error? Especially I need the file/line in the form plugin.

@DimitriSteyaert
Copy link
Author

Oh, this was the entire error I got from the logs, the page in my browser only gave me this error: https://cl.ly/0Z0U0o1K2b0J even though I have debug logging enabled.

@mahagr
Copy link
Member

mahagr commented Feb 16, 2018

Please change Error handler -> Display errors to Full Backtrace Error in the configuration.

@DimitriSteyaert
Copy link
Author

Oh ok, this is the full traceback: https://cl.ly/0o3a293v1D2O

@mahagr
Copy link
Member

mahagr commented Feb 16, 2018

I believe I found the bug. Already fixed it in the form plugin.

@DimitriSteyaert
Copy link
Author

Did you fix it in v2.11.4 because I am already running this version. Or will you release a new version with this fix?

@mahagr
Copy link
Member

mahagr commented Feb 16, 2018

It is released now.

@DimitriSteyaert
Copy link
Author

Hi, this release has solved the error I got but the initial problem still exists. I am not able to send out any mails with the form.

@DimitriSteyaert
Copy link
Author

I'm closing this issue. Although it isn't solved yet I used the workaround at https://learn.getgrav.org/forms/forms#displaying-forms-in-page-content to get a working form on this website, which will do just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants