Fix access to protected property Database_Abstract::$lastQuery

This commit is contained in:
Tim Gerundt 2025-09-15 20:48:22 +02:00
parent 7a50198573
commit 5f94030c47
2 changed files with 5 additions and 1 deletions

View file

@ -200,7 +200,7 @@ class Restore
$db->ex("INSERT INTO {$db->getPrefix()}{$table} ($fieldsStr) VALUES ($subsStr)", $values);
}
catch (Exception $e) {
error_log("Failed query: {$db->lastQuery}");
error_log("Failed query: {$db->getLastQuery()}");
$this->lastErrorString = "Failed to add data to table '{$db->getPrefix()}$table'. Database error (see query in error log): ". $e->getMessage();
return false;
}

View file

@ -100,6 +100,10 @@ abstract class Database_Abstract
}
}
}
function getLastQuery(): string {
return $this->lastQuery;
}
}
abstract class DatabaseResult_Abstract