Cahnged get_base_sales_type()
[fa-stable.git] / includes / errors.inc
index a9b68898498fb0e4f9854e678ad155b86a3bfa57..fc8f4fb692fca3205b277009755fd70291cf90df 100644 (file)
@@ -17,7 +17,7 @@ $before_box = ''; // temporary container for output html data before error box
 //    display in message box.
 
 function error_handler($errno, $errstr, $file, $line) {
-    global $messages, $go_debug;
+    global $messages, $go_debug, $SysPrefs;
 
        // skip well known warnings we don't care about.
        // Please use restrainedly to not risk loss of important messages
@@ -33,7 +33,8 @@ function error_handler($errno, $errstr, $file, $line) {
                        $messages[] = array($errno, $errstr, $file, $line);
        else if($errno&~E_NOTICE)// log all not displayed messages 
                error_log(user_company() . ':' . $_SESSION["wa_current_user"]->loginname.':'
-                        . basename($file) .":$line: $errstr");
+                        . basename($file) .":$line:" . ( $SysPrefs->db_ok ? '':'[before upgrade]')
+                        . " $errstr");
        
     return true;
 }
@@ -94,7 +95,12 @@ function error_box() {
        Helper to avoid sparse log notices.
 */
 function end_flush () {
-               if (ob_get_level()) ob_end_flush();
+       global $Ajax;
+
+       if (isset($Ajax))
+               $Ajax->run();
+
+       if (ob_get_level()) ob_end_flush();
 }
 
 function display_db_error($msg, $sql_statement=null, $exit=true)