BUGFIX: Print an error message if a parameter does not have
authorarjen <arjen>
Tue, 5 Aug 2003 07:46:37 +0000 (07:46 +0000)
committerarjen <arjen>
Tue, 5 Aug 2003 07:46:37 +0000 (07:46 +0000)
any history.

src/gcm_daemon/gcm_daemon.php

index 25cc4ee..edfa844 100755 (executable)
    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++;
+         }
       }
    }