From c8fafe20717acf62d3e7e8bde6fcdc2fa1316023 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 17 Sep 2006 17:55:22 +0000 Subject: [PATCH] r1157: Throw an error if there aren't any products on search.php and newreport.php --- docs/changes.txt | 1 + newreport.php | 5 +++++ search.php | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 53d5779..3082a2b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -6,6 +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 1.1.0 Beta 2 =============================== diff --git a/newreport.php b/newreport.php index b843910..d60868f 100755 --- a/newreport.php +++ b/newreport.php @@ -143,6 +143,11 @@ if ($_POST['do'] == 'insert') if ($_REQUEST['do'] == 'add') { + if (!is_array($bugsys->datastore['product'])) + { + $message->error(_('No products have been setup, therefore no bugs can be added.')); + } + $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', ($bugsys->in['severity'] ? $bugsys->in['severity'] : $bugsys->options['defaultseverity'])); $show['changestatus'] = ((can_perform('canchangestatus')) ? true : false); diff --git a/search.php b/search.php index 711c49b..7a9f641 100644 --- a/search.php +++ b/search.php @@ -322,6 +322,11 @@ if ($_REQUEST['do'] == 'search') if ($newsearch) { + if (!is_array($bugsys->datastore['product'])) + { + $message->error(_('No products are setup, therefore there can be no bugs and thus search cannot function.')); + } + $pcv_select = construct_pcv_select(); // ------------------------------------------------------------------- -- 2.22.5