From: arjen Date: Tue, 5 Aug 2003 07:46:37 +0000 (+0000) Subject: BUGFIX: Print an error message if a parameter does not have X-Git-Tag: V0_0_7~14 X-Git-Url: http://www.andromeda.nl/gitweb/?p=gnucomo.git;a=commitdiff_plain;h=134c7ac1f5e098dffae8a6dc94b30a6a18e025a9 BUGFIX: Print an error message if a parameter does not have any history. --- diff --git a/src/gcm_daemon/gcm_daemon.php b/src/gcm_daemon/gcm_daemon.php index 25cc4ee..edfa844 100755 --- a/src/gcm_daemon/gcm_daemon.php +++ b/src/gcm_daemon/gcm_daemon.php @@ -19,7 +19,11 @@ Gnucomo-0.0.3: December 6th 2002 $Log: gcm_daemon.php,v $ - Revision 1.11 2003-07-09 07:25:02 arjen + Revision 1.12 2003-08-05 07:46:37 arjen + BUGFIX: Print an error message if a parameter does not have + any history. + + Revision 1.11 2003/07/09 07:25:02 arjen Gcm_daemon gathers statistics on parameters, notifications, etc. for all objects. Revision 1.10 2003/03/29 08:33:58 arjen @@ -34,7 +38,7 @@ */ -// $Id: gcm_daemon.php,v 1.11 2003-07-09 07:25:02 arjen Exp $ +// $Id: gcm_daemon.php,v 1.12 2003-08-05 07:46:37 arjen Exp $ ini_set('include_path', '.:./classes:../phpclasses'); @@ -51,7 +55,7 @@ require_once "gnucomo.process_log.php"; $project_name = "gnucomo"; //name of the entire project $app_name = "gcm_daemon"; //name of the application running $developrelease = "TRUE"; //Indicates if special debug settings are needed -$db_version = 41; //The db_version indicates what the level of +$db_version = 42; //The db_version indicates what the level of //the database should be. If the database is //old an update will be generated. $gcmd_version = 5; //This value indicates the active version of the gcm_daemon, @@ -317,10 +321,17 @@ function GatherStatistics($objectid) $qry ="select change_nature from history where paramid= CAST('"; $qry .= $param->paramid . "' AS BIGINT) order by modified desc"; $rhist = $dbms->query($qry); - $hist = $dbms->fetch_object($rhist, 0); - if ($hist->change_nature == "REMOVED") + if ($dbms->num_rows($rhist) == 0) + { + echo "ERROR: No history for parameter id " . $param->paramid . "\n"; + } + else { - $removed_parameters++; + $hist = $dbms->fetch_object($rhist, 0); + if ($hist->change_nature == "REMOVED") + { + $removed_parameters++; + } } }