LDAP: fix null where IUser is expected in update groups background job#23799
LDAP: fix null where IUser is expected in update groups background job#23799
Conversation
Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
89d2b10 to
3a51160
Compare
|
🤖 beep boop beep 🤖 Here are the logs for the failed build: Status of 34809: failuremysql8.0-php7.4Show full log |
| ->from('ldap_group_members'); | ||
| $result = $qb->execute()->fetchAll(); | ||
|
|
||
| $this->groupsFromDB = []; |
There was a problem hiding this comment.
you could use array_map :)
There was a problem hiding this comment.
yes. doesn't make much difference, but perhaps lookin a bit fancier than good ol' foreach. iirc it is also more memory hungry than foreach.
There was a problem hiding this comment.
who cares about memory footprint if you can have fancy 😉
for me it's mostly about readability. If I see an array_map I immediately can guess what's happening.
There was a problem hiding this comment.
Actually can be a concern, depending how users and groups you throw on it. In this case the readability wouldn't really change as it is a one-line-transformation of the result array, either way.
|
/backport to stable20 |
|
/backport to stable19 |
|
/backport to stable18 |
This can happen when a user was already removed, but the DB table was having old information. Previously – with the old events – it did not cause a problem, because an old user id was passed. Now, an IUser object was required. Comes with tests and thus some refactoring against the necessary methods of the job. The actual fix is the second commit.