mirror of
https://github.com/moodle/moodle.git
synced 2025-02-24 20:13:14 +01:00
MDL-83158 Unit tests: Exception when starting database session
Fixes an error where when reading a session the conditional test never fails even when a session record doesn't exist in the database.
This commit is contained in:
parent
09e56f2d1a
commit
68ba22d80f
@ -143,7 +143,7 @@ class database extends handler implements SessionHandlerInterface {
|
|||||||
*/
|
*/
|
||||||
public function read(string $sid): string|false {
|
public function read(string $sid): string|false {
|
||||||
try {
|
try {
|
||||||
if (!$record = $this->get_session_by_sid($sid)) {
|
if (!$record = $this->database->get_record('sessions', ['sid' => $sid])) {
|
||||||
// Let's cheat and skip locking if this is the first access,
|
// Let's cheat and skip locking if this is the first access,
|
||||||
// do not create the record here, let the manager do it after session init.
|
// do not create the record here, let the manager do it after session init.
|
||||||
$this->failed = false;
|
$this->failed = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user