Better error handling
This commit is contained in:
@@ -67,7 +67,7 @@ foreach ($forms[$form_param] as $form_name => $form) {
|
|||||||
$form_display->registerForm($form_name, $form);
|
$form_display->registerForm($form_name, $form);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter_input(INPUT_GET, 'mode') == 'revert') {
|
if (isset($_POST['revert'])) {
|
||||||
// revert erroneous fields to their default values
|
// revert erroneous fields to their default values
|
||||||
$form_display->fixErrors();
|
$form_display->fixErrors();
|
||||||
// redirect
|
// redirect
|
||||||
@@ -82,19 +82,14 @@ if (!$form_display->process(false)) {
|
|||||||
} else {
|
} else {
|
||||||
// check for form errors
|
// check for form errors
|
||||||
if ($form_display->hasErrors()) {
|
if ($form_display->hasErrors()) {
|
||||||
// form has errors, show warning
|
// form has errors
|
||||||
$separator = PMA_get_arg_separator('html');
|
|
||||||
?>
|
?>
|
||||||
<div class="warning">
|
<fieldset>
|
||||||
<h4><?php echo __('Warning') ?></h4>
|
<b><?php echo __('Submitted form contains errors') ?></b>
|
||||||
<?php echo __('Submitted form contains errors') ?><br />
|
<?php $form_display->displayErrors(); ?>
|
||||||
<a href="?form=<?php echo $form_param ?>&mode=revert"><?php echo PMA_lang('RevertErroneousFields') ?></a>
|
</fieldset>
|
||||||
</div>
|
|
||||||
<?php $form_display->displayErrors() ?>
|
|
||||||
<a class="btn" href="user_preferences.php"><?php echo PMA_lang('IgnoreErrors') ?></a>
|
|
||||||
|
|
||||||
<a class="btn" href="?form=<?php echo $form_param ?>&mode=edit"><?php echo PMA_lang('ShowForm') ?></a>
|
|
||||||
<?php
|
<?php
|
||||||
|
$form_display->display(true, true);
|
||||||
} else {
|
} else {
|
||||||
// save settings
|
// save settings
|
||||||
$result = PMA_save_userprefs();
|
$result = PMA_save_userprefs();
|
||||||
|
Reference in New Issue
Block a user