Skip to content

Commit 4279edf

Browse files
committed
Error when importing members #1556
1 parent 423967b commit 4279edf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

adm_program/system/classes/TableMembers.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ public function deleteMembership(int $roleId = 0, int $userId = 0): bool
113113
/**
114114
* Deletes the selected record of the table and optionally sends an admin notification if configured
115115
* @return true Returns **true** if no error occurred
116+
* @throws Exception
116117
*/
117118
public function delete(): bool
118119
{
119120
// Queue admin notification about membership deletion
120-
global $gChangeNotification;
121+
global $gChangeNotification, $gCurrentSession;
121122

122123
// If this is a new record that hasn't been written to the database, simply ignore it
123124
if (!$this->newRecord && is_object($gChangeNotification)) {
@@ -157,7 +158,7 @@ public function delete(): bool
157158
}
158159

159160
// renew user object of the affected user because of edited role assignment
160-
$GLOBALS['gCurrentSession']->reload($this->getValue('mem_usr_id'));
161+
$gCurrentSession->reload((int) $this->getValue('mem_usr_id'));
161162

162163
return parent::delete();
163164
}
@@ -170,6 +171,7 @@ public function delete(): bool
170171
* @param bool $updateFingerPrint Default **true**. Will update the creator or editor of the recordset if table has columns like **usr_id_create** or **usr_id_changed**
171172
* @return bool If an update or insert into the database was done then return true, otherwise false.
172173
* @throws AdmException
174+
* @throws Exception
173175
*/
174176
public function save(bool $updateFingerPrint = true): bool
175177
{
@@ -187,7 +189,7 @@ public function save(bool $updateFingerPrint = true): bool
187189

188190
if ($returnStatus && $gCurrentSession instanceof Session) {
189191
// renew user object of the affected user because of edited role assignment
190-
$gCurrentSession->reload($this->getValue('mem_usr_id'));
192+
$gCurrentSession->reload((int) $this->getValue('mem_usr_id'));
191193
}
192194

193195
if ($newRecord && is_object($gChangeNotification)) {

0 commit comments

Comments
 (0)