#1
o/
After updating Trongate from 1.2.0 to 1.3.3044 and correcting code for new post and segment rewrites im stuck at validation helper goes to standard module controller when run. No db updates or inserts are done.
It seems the validation error text is set when provoking an error, then goes to standard page, same when no validation error.

Have tried from scratch also, desktop app generated code works, but not when creating simple manual modules.
Can anyone confirm this problem?
#2
Hello,
Can you post your code?
Dan
#3
This an example code, when rem $result = $this->validation_helper->run(); and set variable to true it works, if not no db changes and Trongate goes to the standard welcome page. It could be local issues (xamp win with fresh Trongate 1.3.3044) but would be good to know if it works for anybody else.

Controller:



View:
#4
Seems to be a problem with the view file, manual forms dont work, but when using Trongate form helper it generates some csrf_token (laravel thing?) and then it works.

So the conclusion for me is that validation helper requires the form helper.
#5
Hi Leffert,

Thanks for posting your code on the SCA forum and above here too.

You are right about the csrf_token being required in your form - not sure if DC was aware of this when he put that in the validation_helper.php as he did a quick fix on it for another reason a while back.

There is no need to use all the form helper methods, just the form_close() like so:

the above adds the following to your form - obviously with a different csrf_token:

It's not a Laravel thing - just a token for cross-site request forgery.

If you follow the logic in validation_helper.php

line 85 $this->csrf_protect(); is called by default

So if 'csrf_token' is not set in $_POST or password_verify() returns false you are directed to the BASE_URL with csrf_block_request()

Maybe DC will change this behaviour in the future, but for now, adding:

to your form is required for now.