From 75705f7565aceb3e446b0e654530f9856f0835ab Mon Sep 17 00:00:00 2001
From: "Leigh B. Stoller" <stoller@flux.utah.edu>
Date: Wed, 26 Sep 2007 23:53:40 +0000
Subject: [PATCH] Set the error string when the DB entry is missing and return
 null to tell caller about it.

---
 www/dbcheck.php3 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/www/dbcheck.php3 b/www/dbcheck.php3
index 2b2cf3bddb..cdbb5b073c 100644
--- a/www/dbcheck.php3
+++ b/www/dbcheck.php3
@@ -46,6 +46,7 @@ function TBGrabFieldData()
 function TBFieldData($table, $column, $flag = 0)
 {
     global $DBFieldData;
+    global $DBFieldErrstr;
     
     if (! $DBFieldData) {
 	TBGrabFieldData();
@@ -75,8 +76,10 @@ function TBFieldData($table, $column, $flag = 0)
                 # Warn TBOPS
 		TBERROR("TBFieldData: No slot data for $table/$column!", 0);
 	    }
-	    if ($flag & TBDB_CHECKDBSLOT_ERROR)
-		return 0;
+	    if ($flag & TBDB_CHECKDBSLOT_ERROR) {
+		$DBFieldErrstr = "Internal Error";
+		return array(null, null);
+	    }
 	}
 	$fielddata = $DBFieldData["default:default"];
     }
-- 
GitLab