Skip to content

Instantly share code, notes, and snippets.

@vsguts
Created April 4, 2016 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vsguts/18809952121f424392210ef814c67a6f to your computer and use it in GitHub Desktop.
Save vsguts/18809952121f424392210ef814c67a6f to your computer and use it in GitHub Desktop.
diff --git a/app/Tygh/Database/Connection.php b/app/Tygh/Database/Connection.php
index f6f75c3..f8eb039 100644
--- a/app/Tygh/Database/Connection.php
+++ b/app/Tygh/Database/Connection.php
@@ -287,9 +287,10 @@ class Connection
$this->db->freeResult($_result);
+ return is_array($result) ? $result : array();
}
- return is_array($result) ? $result : array();
+ return array();
}
/**
@@ -849,12 +850,16 @@ class Connection
Registry::push('runtime.database.errors', $error);
} else {
+ Registry::set('runtime.database.skip_errors', true);
+
// Log database errors
fn_log_event('database', 'error', array(
'error' => $error,
'backtrace' => debug_backtrace()
));
+ Registry::set('runtime.database.skip_errors', false);
+
throw new DatabaseException($error['message'] . "<p>{$error['query']}</p>");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment