Well, I hate to make less work for people, but ... I made the following changes to the v1.5.2 version of /includes/classes/db/mysql/query_factory.php:
function show_error() {
if ($this->error_number == 0 && $this->error_text == DB_ERROR_NOT_CONNECTED && !headers_sent() && file_exists('nddbc.html') ) include('nddbc.html');
echo '<div class="systemError">';
if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true)
{
echo $this->error_number . ' ' . $this->error_text;
echo '<br />in:<br />[' . (strstr($this->zf_sql, 'db_cache') ? 'db_cache table' : $this->zf_sql) . ']<br />';
} else {
echo 'WARNING: An Error occurred, please refresh the page and try again.';
}
//-bof-20131218-lat9-Determine query_factory caller
$backtrace_array = debug_backtrace();
$query_factory_caller = '';
foreach($backtrace_array as $current_caller) {
if (strcmp($current_caller['file'], __FILE__) != 0) {
$query_factory_caller = ' ==> (as called by) ' . $current_caller['file'] . ' on line ' . $current_caller['line'] . ' <==';
break;
}
}
//-eof-20131218-lat9
trigger_error($this->error_number . ':' . $this->error_text . ' :: ' . $this->zf_sql . $query_factory_caller, E_USER_ERROR); //-20131218-lat9-added debug_backtrace
if (defined('IS_ADMIN_FLAG') && IS_ADMIN_FLAG==true) echo 'If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.<br />';
echo '</div>';
}
and created this naughty file (/includes/functions/extra_functions/make_queryfactory_error.php:
<?php
$value = $db->Execute("SELECT unknown_field from " . TABLE_ORDERS . " WHERE orders_id = 1");
which resulted in the following debug log file:
[18-Dec-2013 20:41:10 Europe/Berlin] PHP Fatal error: 1054:Unknown column 'unknown_field' in 'field list' :: SELECT unknown_field from orders WHERE orders_id = 1 ==> (as called by) C:\xampp\htdocs\v1.5.2\includes\functions\extra_functions\make_queryfactory_error.php on line 2 <== in C:\xampp\htdocs\v1.5.2\includes\classes\db\mysql\query_factory.php on line 153