Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(UpdateNotifications): Handle numeric user ids #44093

Closed

Conversation

joshtrichards
Copy link
Member

Summary

getUsersToNotify() uses array_key so when $uid happens to be numeric it ends up needing to be cast here (similar to #15912).

Backports will need to be done manually due to restructure that occurred in >v28 (I'll follow-up with those).

TODO

  • ...

Checklist

Closes #44051 

Signed-off-by: Josh <josh.t.richards@gmail.com>
@@ -121,7 +121,7 @@
->setSubject('connection_error', ['days' => $numDays]);

foreach ($this->getUsersToNotify() as $uid) {
$notification->setUser($uid);
$notification->setUser((string) $uid);

Check notice

Code scanning / Psalm

RedundantCastGivenDocblockType Note

Redundant cast to string given docblock-provided type
@@ -189,7 +189,7 @@
}

foreach ($this->getUsersToNotify() as $uid) {
$notification->setUser($uid);
$notification->setUser((string) $uid);

Check notice

Code scanning / Psalm

RedundantCastGivenDocblockType Note

Redundant cast to string given docblock-provided type
joshtrichards added a commit that referenced this pull request Mar 8, 2024
manual backport of #44093 to fix #44051 for <=v28

Signed-off-by: Josh <josh.t.richards@gmail.com>
@susnux
Copy link
Contributor

susnux commented Mar 8, 2024

getUsersToNotify() uses array_key

This is no longer the case, array_unique and array_values are used.

@nickvergessen
Copy link
Member

28 and lower with the bug is fixed via #44095

@nickvergessen nickvergessen deleted the fix/updatenotifications/numeric-ids-master branch March 8, 2024 22:15
backportbot bot pushed a commit that referenced this pull request Mar 8, 2024
manual backport of #44093 to fix #44051 for <=v28

Signed-off-by: Josh <josh.t.richards@gmail.com>
backportbot bot pushed a commit that referenced this pull request Mar 8, 2024
manual backport of #44093 to fix #44051 for <=v28

Signed-off-by: Josh <josh.t.richards@gmail.com>
joshtrichards added a commit that referenced this pull request Mar 10, 2024
manual backport of #44093 to fix #44051 for <=v28

Signed-off-by: Josh <josh.t.richards@gmail.com>
joshtrichards added a commit that referenced this pull request Mar 12, 2024
manual backport of #44093 to fix #44051 for <=v28

Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Nummeric user id breaks updatenotifications
3 participants