From a0a7861f71bd0447bf8fabd2cd7532701be4e04c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 17 Sep 2006 18:01:30 +0000 Subject: [PATCH] r1159: Add checks for versions, too! --- docs/changes.txt | 2 +- newreport.php | 4 ++++ search.php | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index 3082a2b..ab6597d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -6,7 +6,7 @@ - Fix the correct stylevar for language codes - Fixed another can_perform() product-based permissions check [search.php] - More changes to syndicate.php to increase performance -- Add checks to newreport.php and search.php to see if there are products, if there aren't, then throw a message about needing them to be setup +- Add checks to newreport.php and search.php to see if there are products or versions, if there aren't, then throw a message about needing them to be setup 1.1.0 Beta 2 =============================== diff --git a/newreport.php b/newreport.php index d60868f..4e94f3d 100755 --- a/newreport.php +++ b/newreport.php @@ -147,6 +147,10 @@ if ($_REQUEST['do'] == 'add') { $message->error(_('No products have been setup, therefore no bugs can be added.')); } + if (!is_array($bugsys->datastore['version'])) + { + $message->error(_('No versions have been setup underneath your product(s), therefore no bugs can be added.')); + } $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', ($bugsys->in['severity'] ? $bugsys->in['severity'] : $bugsys->options['defaultseverity'])); diff --git a/search.php b/search.php index 7a9f641..75855b6 100644 --- a/search.php +++ b/search.php @@ -327,6 +327,11 @@ if ($_REQUEST['do'] == 'search') $message->error(_('No products are setup, therefore there can be no bugs and thus search cannot function.')); } + if (!is_array($bugsys->datastore['version'])) + { + $message->error(_('No versions have been added underneath your product(s), there can be no bugs and thus search cannot function.')); + } + $pcv_select = construct_pcv_select(); // ------------------------------------------------------------------- -- 2.43.5