Bug #21557 » 0012598.patch

Administrator Admin, 2009-11-15 17:57

View differences:

t3lib/class.t3lib_db.php (Arbeitskopie)
1252 1252

  
1253 1253
		$error = $this->sql_error();
1254 1254
		if ($error) {
1255
			debug(
1256
				array(
1257
					'caller' => 't3lib_DB::' . $func,
1258
					'ERROR' => $error,
1259
					'lastBuiltQuery' => ($query ? $query : $this->debug_lastBuiltQuery),
1260
					'debug_backtrace' => t3lib_div::debug_trail(),
1261
				),
1262
				'SQL debug'
1263
			);
1255
				// Backend: Use flash messages to visualize the information
1256
			if (TYPO3_MODE === 'BE') {
1257
				$message = t3lib_div::view_array(
1258
					array(
1259
						'caller' => 't3lib_DB::' . $func,
1260
						'lastBuiltQuery' => ($query ? $query : $this->debug_lastBuiltQuery),
1261
						'debug_backtrace' => t3lib_div::debug_trail(),
1262
					)
1263
				);
1264
				$flashMessage = t3lib_div::makeInstance(
1265
					't3lib_FlashMessage',
1266
					$message,
1267
					'TYPO3 Database Error: ' . $error,
1268
					t3lib_FlashMessage::ERROR
1269
				);
1270
				t3lib_FlashMessageQueue::addMessage($flashMessage);
1271
				// Frontend: Output directly
1272
			} else {
1273
				debug(
1274
					array(
1275
						'caller' => 't3lib_DB::' . $func,
1276
						'ERROR' => $error,
1277
						'lastBuiltQuery' => ($query ? $query : $this->debug_lastBuiltQuery),
1278
						'debug_backtrace' => t3lib_div::debug_trail(),
1279
					),
1280
					'SQL debug'
1281
				);
1282
			}
1283
			
1264 1284
		}
1265 1285
	}
1266 1286

  
(1-1/3)