projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed get_standard_cost() result for dummy items.
[fa-stable.git]
/
includes
/
errors.inc
diff --git
a/includes/errors.inc
b/includes/errors.inc
index 1bbc71ff3ea917dc1af36380dd72109958100804..f2cfe1c0fc1b113c6fee2e58706969c0b2484b27 100644
(file)
--- a/
includes/errors.inc
+++ b/
includes/errors.inc
@@
-84,9
+84,9
@@
function error_box() {
global $before_box;
echo "<div id='msgbox'>";
global $before_box;
echo "<div id='msgbox'>";
- $before_box = ob_get_clean(); // save html content before error box
+
// Necessary restart instead of get_contents/clean calls due to a bug in php 4.3.2
// Necessary restart instead of get_contents/clean calls due to a bug in php 4.3.2
- register_shutdown_function('end_flush');
+ $before_box = ob_get_clean(); // save html content before error box
ob_start('output_html');
echo "</div>";
}
ob_start('output_html');
echo "</div>";
}
@@
-94,7
+94,12
@@
function error_box() {
Helper to avoid sparse log notices.
*/
function end_flush () {
Helper to avoid sparse log notices.
*/
function end_flush () {
- if (ob_get_level()) ob_end_flush();
+ global $Ajax;
+
+ if (isset($Ajax))
+ $Ajax->run();
+ // flush all output buffers (works also with exit inside any div levels)
+ while(ob_get_level()) ob_end_flush();
}
function display_db_error($msg, $sql_statement=null, $exit=true)
}
function display_db_error($msg, $sql_statement=null, $exit=true)
@@
-130,15
+135,13
@@
function display_db_error($msg, $sql_statement=null, $exit=true)
exit;
}
exit;
}
-function frindly_db_error($db_error
, $sql
)
+function frindly_db_error($db_error)
{
{
- global $db_duplicate_error_code
, $go_debug
;
+ global $db_duplicate_error_code;
if ($db_error == $db_duplicate_error_code)
if ($db_error == $db_duplicate_error_code)
- { $msg = _("The entered information is a duplicate. Please go back and enter different values.");
- if ($go_debug)
- $msg .= '<br>Sql that failed was :<br>'.$sql;
- display_error($msg);
+ {
+ display_error(_("The entered information is a duplicate. Please go back and enter different values."));
return true;
}
return true;
}
@@
-147,13
+150,13
@@
function frindly_db_error($db_error, $sql)
function check_db_error($msg, $sql_statement, $exit_if_error=true, $rollback_if_error=true)
{
function check_db_error($msg, $sql_statement, $exit_if_error=true, $rollback_if_error=true)
{
- global $db;
+ global $db
, $go_debug
;
$db_error = db_error_no();
if ($db_error != 0)
{
$db_error = db_error_no();
if ($db_error != 0)
{
- if (
!frindly_db_error($db_error, $sql_statement
)) {
+ if (
$go_debug || !frindly_db_error($db_error
)) {
display_db_error($msg, $sql_statement, false);
}
display_db_error($msg, $sql_statement, false);
}