Permalink
Browse files

Fix #2967918, display bug when creating a FTS conf with multi errors.…

… Reported by Alexey Baturin.
  • Loading branch information...
1 parent 6ec5a61 commit 4e8b7048a33a12e6f007aadd80ee52554332c80f Jehan-Guillaume (ioguix) de Rorthais committed Mar 11, 2010
Showing with 16 additions and 14 deletions.
  1. +16 −14 fulltext.php
View
30 fulltext.php
@@ -229,23 +229,25 @@ function doCreateConfig($msg = '') {
function doSaveCreateConfig() {
global $data, $lang, $_reload_browser;
+ $err = '';
// Check that they've given a name
- if ($_POST['formName'] == '') doCreateConfig($lang['strftsconfigneedsname']);
- if (($_POST['formParser'] != '') && ($_POST['formTemplate'] != '')) doCreateConfig($lang['strftscantparsercopy']);
- else {
- if ($_POST['formParser'] != '') $formParser = unserialize($_POST['formParser']);
- else $formParser = '';
- if ($_POST['formTemplate'] != '') $formTemplate = unserialize($_POST['formTemplate']);
- else $formTemplate = '';
+ if ($_POST['formName'] == '') $err .= "{$lang['strftsconfigneedsname']}<br />";
+ if (($_POST['formParser'] != '') && ($_POST['formTemplate'] != '')) $err .= "{$lang['strftscantparsercopy']}<br />";
- $status = $data->createFtsConfiguration($_POST['formName'], $formParser, $formTemplate, $_POST['formComment']);
- if ($status == 0) {
- $_reload_browser = true;
- doDefault($lang['strftsconfigcreated']);
- }
- else
- doCreateConfig($lang['strftsconfigcreatedbad']);
+ if ($err != '') return doCreateConfig($err);
+
+ if ($_POST['formParser'] != '') $formParser = unserialize($_POST['formParser']);
+ else $formParser = '';
+ if ($_POST['formTemplate'] != '') $formTemplate = unserialize($_POST['formTemplate']);
+ else $formTemplate = '';
+
+ $status = $data->createFtsConfiguration($_POST['formName'], $formParser, $formTemplate, $_POST['formComment']);
+ if ($status == 0) {
+ $_reload_browser = true;
+ doDefault($lang['strftsconfigcreated']);
}
+ else
+ doCreateConfig($lang['strftsconfigcreatedbad']);
}
/**

0 comments on commit 4e8b704

Please sign in to comment.