Issue #3304883 by mcdruid, poker10: [D7 PHP 8.2] Deprecated function: Creation of dynamic property in PDOException class

merge-requests/3045/head
Juraj Nemec 2022-11-16 21:50:08 +01:00
parent 9a82e007b0
commit ef48d5d56b
No known key found for this signature in database
GPG Key ID: 01EC3E1EECB5B2CA
3 changed files with 8 additions and 8 deletions

View File

@ -764,12 +764,12 @@ abstract class DatabaseConnection {
if ($options['throw_exception']) {
// Add additional debug information.
if ($query instanceof DatabaseStatementInterface) {
$e->query_string = $stmt->getQueryString();
$e->errorInfo['query_string'] = $stmt->getQueryString();
}
else {
$e->query_string = $query;
$e->errorInfo['query_string'] = $query;
}
$e->args = $args;
$e->errorInfo['args'] = $args;
throw $e;
}
return NULL;

View File

@ -129,12 +129,12 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
if ($options['throw_exception']) {
// Add additional debug information.
if ($query instanceof DatabaseStatementInterface) {
$e->query_string = $stmt->getQueryString();
$e->errorInfo['query_string'] = $stmt->getQueryString();
}
else {
$e->query_string = $query;
$e->errorInfo['query_string'] = $query;
}
$e->args = $args;
$e->errorInfo['args'] = $args;
throw $e;
}
return NULL;

View File

@ -103,8 +103,8 @@ function _drupal_decode_exception($exception) {
// We remove that call.
array_shift($backtrace);
}
if (isset($exception->query_string, $exception->args)) {
$message .= ": " . $exception->query_string . "; " . print_r($exception->args, TRUE);
if (isset($exception->errorInfo['query_string'], $exception->errorInfo['args'])) {
$message .= ": " . $exception->errorInfo['query_string'] . "; " . print_r($exception->errorInfo['args'], TRUE);
}
}
$caller = _drupal_get_last_caller($backtrace);