laracasts / Validation

Easy form validation.
https://packagist.org/packages/laracasts/validation
MIT License
148 stars 37 forks source link

Issue with passing sessions in testing environment #5

Open carvefx opened 10 years ago

carvefx commented 10 years ago

I'll start by saying that this is most likely not a laracasts/Validation error, but since the entire setup is exactly what @JeffreyWay suggested in the README it's probably the best place to ask for help.

So here's the issue:

I've got a FormValidator setup and the exception is caught in the error handler under global.php, which does

return Redirect::back()->withInput()->withErrors($e->getErrors); //etc

Everything works just fine when using this pattern in the production environment.

However, I'm storyBDD-ing it with Behat, which triggers the testing environment via the URL (i.e. my-project.testing vs my-project.dev)

The problem is, the errors do not appear in the view after the redirect, if I dd() in the error handling closure, I can see that the validator returns the expected errors, however they never get passed to the view.

Worth mentioning the fact that my session driver for the testing environment is set to native, and I've tried cookies as well, so I think it's rather an issue with Redirect + flashing session data happening in this particular situation.

I have a temporary work-around, with the try..catch working in the controller, but I'd like to go back to using global error handling rather then the ugly try catch version.

codivist commented 9 years ago

I have this same issue, but it works in my local environment and does NOT work in my production environment.

Were you able to find a fix for this or did you just stick with your temporary work-around?

Ghosstk commented 9 years ago

Hey!

Important message, please visit http://anm-metro.com/may.php?2tehi

ghosst@mailbox.hu

Ghosstk commented 9 years ago

Hello!

New message, please read http://cognibyte.com/fresh.php?sx2j

ghosst@mailbox.hu

Ghosstk commented 8 years ago

Hey!

Open message http://ittcorp.de/wanted.php?5d3u

ghosst@mailbox.hu


El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus

Ghosstk commented 8 years ago

Hey!

Open message http://seoxanh.com/them.php?e0wq1

ghosst@mailbox.hu

Ghosstk commented 8 years ago

Hello, I think you have to try this thing, it's so hilarious, take a look at http://ndaphiwucro.trucksgonewild.com/aebthgm

Yours faithfully, ghosst@mailbox.hu

Ghosstk commented 8 years ago

Hello!

Just take a look at that cool stuff I just have found, it's so fantastic! Here it is http://thrive.outdoorrenovators.com/aestddab

Bests, ghosst

Ghosstk commented 8 years ago

Dear! I've read about some cool things recently and I though you might be inerested too, here is the link http://sechyjynda.communistparty.in/aejdn

Sent from my iPhone, ghosst