forkcms/forkcms — pull request #443 by Diewy (2013-03-29 14:22:13+00:00)
Title: Output should be the last command to execute

Before 3.5 the output function for Ajax actions did an `exit;`. Now we have to make sure that if the output function is used, it is the last line that will be executed in that function.

E.g. for the validation of adding a Category; If the validation fails, the insert function may not be executed. (duh)

* Most of the time for a BAD_REQUEST I used an `if ... else ...` (See check_status.php from the analytics module)
* If it would become too nested I made an errors array. (See link_account.php from the mailmotor settings)
* If a catch block was used in the middle of a function I used `return;` to prevent executing the additional lines. (See test_email_connection.php:61 from the settings module)

This should fix 23 small bugs, like the validation of adding fields in formbuilder etc.