Skip to content

fix: cast boardUsers to string#8066

Merged
blizzz merged 2 commits into
mainfrom
fix/cast-boardUsers-keys-to-string
Jun 22, 2026
Merged

fix: cast boardUsers to string#8066
blizzz merged 2 commits into
mainfrom
fix/cast-boardUsers-keys-to-string

Conversation

@grnd-alt

Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: grnd-alt <git@belakkaf.net>
@grnd-alt grnd-alt requested a review from luka-nextcloud as a code owner June 15, 2026 10:19
@grnd-alt

Copy link
Copy Markdown
Member Author

/backport to stable34

@grnd-alt

Copy link
Copy Markdown
Member Author

/backport to stable33

@grnd-alt

Copy link
Copy Markdown
Member Author

/backport to stable32

@grnd-alt

Copy link
Copy Markdown
Member Author

/backport to stable31

@grnd-alt

Copy link
Copy Markdown
Member Author

/backport to stable33

$card = $this->cardMapper->find($cardId);
$boardId = $this->cardMapper->findBoardId($cardId);
$boardUsers = array_keys($this->permissionService->findUsers($boardId, true));
$boardUsers = array_map(fn (string|int $userId) => (string)$userId, array_keys($this->permissionService->findUsers($boardId, true)));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

php converts array keys, that are inserted as strings, to int if possible, so the later in_array fails if the user_id passed is a string but boardUsers contains ints for numeric userIds

@github-actions

Copy link
Copy Markdown
Contributor

🐢 Performance warning.
It looks like the query count of the integration tests increased with this PR.
Database query count is now 96645 was 93102 (+3.8%)
Please check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.

@grnd-alt grnd-alt requested a review from blizzz June 22, 2026 11:47
@blizzz blizzz merged commit 48cc192 into main Jun 22, 2026
41 checks passed
@blizzz blizzz deleted the fix/cast-boardUsers-keys-to-string branch June 22, 2026 12:35
@backportbot

backportbot Bot commented Jun 22, 2026

Copy link
Copy Markdown

The backport to stable31 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable31
git pull origin stable31

# Create the new backport branch
git checkout -b backport/8066/stable31

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick f562e3d0

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/8066/stable31

Error: Failed to check for changes with origin/stable31: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

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.

2 participants