File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
tests/integration/features/api Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 1313use OCP \AppFramework \Db \MultipleObjectsReturnedException ;
1414use OCP \AppFramework \Db \QBMapper ;
1515use OCP \IDBConnection ;
16+ use PDO ;
1617
1718/** @template-extends QBMapper<FieldValue> */
1819class FieldValueMapper extends QBMapper {
@@ -98,7 +99,7 @@ public function findDistinctUserUids(): array {
9899 ->orderBy ('user_uid ' , 'ASC ' );
99100
100101 $ cursor = $ qb ->executeQuery ();
101- $ userUids = $ cursor ->fetchFirstColumn ( );
102+ $ userUids = $ cursor ->fetchAll ( PDO :: FETCH_COLUMN );
102103 $ cursor ->closeCursor ();
103104
104105 return array_values (array_map (static fn (mixed $ uid ): string => (string )$ uid , $ userUids ));
Original file line number Diff line number Diff line change 1+ Feature : orphaned profile field value repair
2+ Background :
3+ Given user "repairuser" exists
4+ And run the command "profile_fields:developer:reset --all" with result code 0
5+
6+ Scenario : maintenance:repair removes values for deleted users without errors
7+ Given as user "admin"
8+ When sending "post" to ocs "/apps/profile_fields/api/v1/definitions"
9+ | fieldKey | repair_test_field |
10+ | label | Repair test |
11+ | type | text |
12+ | editPolicy | users |
13+ | exposurePolicy | private |
14+ | sortOrder | 10 |
15+ | active | true |
16+ Then the response should have a status code 201
17+ And fetch field "(REPAIR_FIELD_ID)(jq).ocs.data.id" from previous JSON response
18+ When sending "put" to ocs "/apps/profile_fields/api/v1/users/repairuser/values/<REPAIR_FIELD_ID>"
19+ | value | orphaned |
20+ Then the response should have a status code 200
21+ And run the command "user:delete repairuser" with result code 0
22+ And run the command "maintenance:repair" with result code 0
23+ And the output of the last command should contain the following text:
24+ """
25+ Repair orphaned profile field values
26+ """
You can’t perform that action at this time.
0 commit comments