Revision: 1093
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1093&view=rev
Author:   cimorrison
Date:     2009-04-16 14:39:16 +0000 (Thu, 16 Apr 2009)

Log Message:
-----------
- Improved error handling when making a booking and writing to the table fails. 
  MRBS now halts with a fatal error message, instead of continuing and silently 
ignoring the error.   There have been a number of reports on the mailing list 
of administrators baffled by this, when the cause is usually that the MRBS 
tables have not been set up properly.

- Fixed a problem causing an HTML validation error when a fatal error message 
is output.

Modified Paths:
--------------
    mrbs/trunk/web/functions.inc
    mrbs/trunk/web/mrbs_sql.inc

Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc        2009-04-16 13:23:57 UTC (rev 1092)
+++ mrbs/trunk/web/functions.inc        2009-04-16 14:39:16 UTC (rev 1093)
@@ -231,7 +231,7 @@
   {
     print_header(0, 0, 0, 0, "");
   }
-  echo $message;
+  echo "<p>$message</p>";
   require_once "trailer.inc";
   exit;
 }

Modified: mrbs/trunk/web/mrbs_sql.inc
===================================================================
--- mrbs/trunk/web/mrbs_sql.inc 2009-04-16 13:23:57 UTC (rev 1092)
+++ mrbs/trunk/web/mrbs_sql.inc 2009-04-16 14:39:16 UTC (rev 1093)
@@ -39,7 +39,7 @@
   $res = sql_query($sql);
   if (! $res)
   {
-    return sql_error();
+    fatal_error(TRUE, "Fatal error: " . sql_error());  // probably because the 
table hasn't been created properly
   }
   if (sql_count($res) == 0)
   {
@@ -185,7 +185,7 @@
 
     if (sql_command($sql) < 0)
     {
-      return 0;
+      fatal_error(TRUE, "Fatal error: " . sql_error());  // probably because 
the table hasn't been created properly
     }
 
     return sql_insert_id("$tbl_entry", "id");
@@ -264,7 +264,7 @@
 
   if (sql_command($sql) < 0)
   {
-    return 0;
+    fatal_error(TRUE, "Fatal error: " . sql_error());  // probably because the 
table hasn't been created properly
   }
 
   return sql_insert_id("$tbl_repeat", "id");


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to