Commit c1f6172f authored by Carsten  Rose's avatar Carsten Rose
Browse files

Refs #11998 - function() is now fired even if there is no 'sql = ...'. NEW:...

Refs #11998 - function() is now fired even if there is no 'sql = ...'. NEW: '10.sql=' is allowed and 'shead' and 'althead' are processed even if 10.sql is an empty string.
parent 1e49ae1a
Pipeline #5048 passed with stages
in 3 minutes and 41 seconds
...@@ -285,7 +285,7 @@ class Report { ...@@ -285,7 +285,7 @@ class Report {
// frCmd = "sql" // frCmd = "sql"
$frCmd = $arrKey[count($arrKey) - 1]; $frCmd = $arrKey[count($arrKey) - 1];
// Check if token is known
if (strpos('|' . strtolower(TOKEN_VALID_LIST) . '|', '|' . $frCmd . '|') === false) { if (strpos('|' . strtolower(TOKEN_VALID_LIST) . '|', '|' . $frCmd . '|') === false) {
throw new \UserReportException ("Unknown token: $frCmd in Line '$ttLine''", ERROR_UNKNOWN_TOKEN); throw new \UserReportException ("Unknown token: $frCmd in Line '$ttLine''", ERROR_UNKNOWN_TOKEN);
} }
...@@ -321,9 +321,7 @@ class Report { ...@@ -321,9 +321,7 @@ class Report {
// per sql command // per sql command
//pro sql cmd wird der Indexarray abgefüllt. Dieser wird später verwendet um auf den $frArray zuzugreifen //pro sql cmd wird der Indexarray abgefüllt. Dieser wird später verwendet um auf den $frArray zuzugreifen
//if(preg_match("/^sql/i", $frCmd) == 1){ if ($frCmd === TOKEN_SQL || $frCmd === TOKEN_FUNCTION) {
// if ($frCmd === TOKEN_FORM || $frCmd === TOKEN_SQL) {
if ($frCmd === TOKEN_SQL) {
// Remember max level // Remember max level
$this->levelCount = max(substr_count($level, '.') + 1, $this->levelCount); $this->levelCount = max(substr_count($level, '.') + 1, $this->levelCount);
// $indexArray[10][50][5] // $indexArray[10][50][5]
...@@ -562,9 +560,14 @@ class Report { ...@@ -562,9 +560,14 @@ class Report {
FormAsFile::importAllForms($this->db, false, true); FormAsFile::importAllForms($this->db, false, true);
} }
$stat = array();
$stat[DB_NUM_ROWS] = 0;
$result = array();
//Execute SQL. All errors have been already catched. //Execute SQL. All errors have been already catched.
unset($result); if ($sql != '') {
$result = $this->db->sql($sql, ROW_KEYS, array(), '', $keys, $stat); $result = $this->db->sql($sql, ROW_KEYS, array(), '', $keys, $stat);
}
// If an array is returned, $sql was a query, otherwise an 'insert', 'update', 'delete', ... // If an array is returned, $sql was a query, otherwise an 'insert', 'update', 'delete', ...
// Query: total number of rows // Query: total number of rows
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment