Commit Graph

28 Commits

Author SHA1 Message Date
Arne Bartelt
bffa4d0925 fix: resolve MySQL Error 1093 when deleting users from boards
Fixes #7125 and #7069 by implementing a two-step deletion process
that avoids MySQL's restriction on deleting from a table while
selecting from it in a subquery.

The fix separates the SELECT and DELETE operations:
1. First query: Get card IDs for assignments to delete
2. Second query: Delete assignments using the collected IDs

This approach works on all supported database systems (MySQL 5.7+,
MySQL 8.0+, MariaDB 10.x+) and follows MySQL's official best practices
for handling Error 1093: 'You can't specify target table for update in FROM clause'.

The issue occurred because the original deleteByParticipantOnBoard method
used a subquery that referenced the same table being deleted from,
which MySQL prohibits but MariaDB allows (explaining why it worked
in development but failed in production).

Signed-off-by: Arne Bartelt <arne.bartelt@gmail.com>
Signed-off-by: Arne Bartelt <Arne.Bartelt@gmail.com>
2025-09-10 16:39:51 +02:00
grnd-alt
899d8a6531 fix: only delete assignments on unshared board (#6932)
Signed-off-by: grnd-alt <github@belakkaf.net>
2025-04-23 11:37:17 +02:00
Julius Knorr
86cb011a5c style: Fix php-cs issues
Signed-off-by: Julius Knorr <jus@bitgrid.net>
2024-12-17 09:22:00 +01:00
Andy Scherzinger
be11113d32 chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-07 15:51:49 +02:00
Julius Härtl
b4de6a8f96 fix: Chunk in-queries to 1000 items
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-02-17 09:16:43 +01:00
Julius Härtl
81c0d96357 perf: Make fetching user details lazy
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-02-17 09:16:26 +01:00
Julius Härtl
23813b7a03 perf: Add mapper methods to get multiple labels/assignments for cards
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-02-17 09:16:26 +01:00
Julius Härtl
c739d543c2 chore: Fix new psalm errors
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-12-30 14:08:31 +01:00
Carl Schwan
44481e1c2a Switch from OC::$server->get to OCP\Server::get
And add a bit more typing to some classes + psalm issues

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-12 10:55:36 +02:00
Raul
815b8597d1 Use numeric typehint instead of int to allow for numeric strings to be passed to find methods. Fixes the psalm check.
Signed-off-by: Raul <raul@nextcloud.com>
2022-04-13 12:39:39 +02:00
Julius Härtl
c2144373d9 fix: Properly handle limited scope for remapping users
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-03-22 08:23:29 +01:00
Julius Härtl
a45e46f80a Allow transfer of single boards
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-03-22 08:23:29 +01:00
Luka Trovic
4615926e3b fix: integration tests
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2022-03-22 08:23:28 +01:00
Luka Trovic
afbbdf0c1b fix: unit test & psalm static code analysis issues
Signed-off-by: Luka Trovic <luka@nextcloud.com>
2022-03-22 08:23:28 +01:00
Max
4d3dabb94e fix: Assignment is the new AssignedUsers
Signed-off-by: Max <max@nextcloud.com>
2022-03-22 08:23:27 +01:00
Julius Härtl
e8ada52c37 Make queries work with the new base mapper
Signed-off-by: Julius Härtl <jus@bitgrid.net>

fix: conflicts
2022-03-22 08:23:27 +01:00
Sergey Shliakhov
6106066460 Fix coding styles
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Max <max@nextcloud.com>
2022-03-22 08:23:27 +01:00
Sergey Shliakhov
7df4b7c4bf Transfer deck ownership even if target user already participant of a board
https://github.com/nextcloud/deck/pull/1955#issuecomment-640392715
Signed-off-by: Sergey Shliakhov <husband.sergey@gmail.com>
2022-03-22 08:23:27 +01:00
Sergey Shliakhov
8b45495214 Check type before transfer card participants ownership
Signed-off-by: Sergey Shliakhov <husband.sergey@gmail.com>

temp
2022-03-22 08:23:26 +01:00
Sergey Shliakhov
b45c454ce2 Fix code style
Signed-off-by: Sergey Shliakhov <husband.sergey@gmail.com>
2022-03-22 08:23:26 +01:00
Sergey Shliakhov
19a2aeb5e5 Update docs
Signed-off-by: Sergey Shliakhov <husband.sergey@gmail.com>

fix: conflicts
2022-03-22 08:23:26 +01:00
Julius Härtl
b657967cac Fix ParamNameMismatch occurences
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-06-10 08:01:27 +02:00
Julius Härtl
4e92faa517 Do not error on deprecated methods for now
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-28 14:48:52 +01:00
Julius Härtl
a461699d42 Adjust rename in tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-10 15:36:55 +01:00
Julius Härtl
f031717a54 Type hint IPermissionMapper
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-10 15:25:25 +01:00
Julius Härtl
9b366857ab Rename find to findAll
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-10 15:25:25 +01:00
Julius Härtl
d66068cdcd Move AssignmentMapper to query builder
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-10 15:25:24 +01:00
Julius Härtl
67fe250248 Refactor class names to Assignment
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-10 15:25:24 +01:00