From a863faaae24514c1bbe07575126e98167e3d194a Mon Sep 17 00:00:00 2001 From: frytimo Date: Thu, 27 Jun 2024 14:26:16 -0300 Subject: [PATCH] fix the user_uuid missing from transaction tables (#7026) Co-authored-by: Tim Fry --- resources/classes/database.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/classes/database.php b/resources/classes/database.php index 4cc1891059..0a7bbdf281 100644 --- a/resources/classes/database.php +++ b/resources/classes/database.php @@ -316,6 +316,14 @@ if (isset($params['domain_uuid'])) { $this->domain_uuid = $params['domain_uuid']; } + + //allow passed user_uuid in the constructor to override the session user_uuid + if (isset($params['user_uuid'])) { + $this->user_uuid = $params['user_uuid']; + } else { + //try to determine the current user_uuid using the session + $this->user_uuid = (!empty($_SESSION['user_uuid']) ? $_SESSION['user_uuid'] : null); + } } /**