From dfb3dd8bd920724290019154a33cb9c81bb4af74 Mon Sep 17 00:00:00 2001 From: Meteo Date: Fri, 15 May 2026 22:08:41 +0200 Subject: [PATCH] Problem with creating a user-group, it does not create the permissions for the new user group and generates a 500 error. --- pub/api/classes/API.php | 1 + pub/api/classes/API_usergroups.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pub/api/classes/API.php b/pub/api/classes/API.php index 56de5ae..2a385ac 100644 --- a/pub/api/classes/API.php +++ b/pub/api/classes/API.php @@ -688,6 +688,7 @@ class API protected function buildDynamicQuery(string $tableName): array { + unset($this->baseQuery); if (!$this->baseQuery) { $this->baseQuery = "SELECT * FROM " . $tableName; } diff --git a/pub/api/classes/API_usergroups.php b/pub/api/classes/API_usergroups.php index b726f9b..c393b55 100644 --- a/pub/api/classes/API_usergroups.php +++ b/pub/api/classes/API_usergroups.php @@ -34,8 +34,8 @@ class API_usergroups extends API $query = "INSERT INTO vc_user_groups (user_group_uuid, user_group_name, user_group_slugify, user_group_weight, user_group_type, user_group_create_timestamp) VALUES (UUID(), ?, ?, ?, ?, ?)"; $stmt = $this->prepareStatement($query); - $stmt->bind_param("ssisi", $this->data['user_group_name'], $this->data['user_group_slugify'], $this->data['user_group_weight'], $this->data['user_group_type'], time()); - + $timestamp = time(); + $stmt->bind_param("ssisi", $this->data['user_group_name'], $this->data['user_group_slugify'], $this->data['user_group_weight'], $this->data['user_group_type'], $timestamp); $this->executeStatement($stmt); $user_group = $this->getUsergroup(); $user_group_uuid = $user_group[0]['user_group_uuid'];