|
22 | 22 | use OCA\Tables\Service\ColumnService; |
23 | 23 | use OCA\Tables\Service\TableService; |
24 | 24 | use OCA\Tables\Service\ViewService; |
| 25 | +use OCA\Tables\Vendor\Symfony\Component\Uid\Uuid; |
25 | 26 | use OCP\App\IAppManager; |
26 | 27 | use OCP\AppFramework\Http; |
27 | 28 | use OCP\AppFramework\Http\Attribute\NoAdminRequired; |
@@ -153,6 +154,9 @@ public function createFromScheme(string $title, string $emoji, string $descripti |
153 | 154 | $table = $this->service->create($title, 'custom', $emoji, $description); |
154 | 155 | $colMap = []; |
155 | 156 | foreach ($columns as $column) { |
| 157 | + if (isset($column['uuid']) && !Uuid::isValid($column['uuid'])) { |
| 158 | + throw new \InvalidArgumentException('Invalid UUID provided'); |
| 159 | + } |
156 | 160 | $col = $this->columnService->create( |
157 | 161 | $this->userId, |
158 | 162 | $table->getId(), |
@@ -182,7 +186,8 @@ public function createFromScheme(string $title, string $emoji, string $descripti |
182 | 186 | usergroupSelectGroups: $column['usergroupSelectGroups'], |
183 | 187 | usergroupSelectTeams: $column['usergroupSelectTeams'], |
184 | 188 | showUserStatus: $column['showUserStatus'], |
185 | | - customSettings: empty($column['customSettings']) ? null : json_encode($column['customSettings']) |
| 189 | + customSettings: empty($column['customSettings']) ? null : json_encode($column['customSettings']), |
| 190 | + uuid: $column['uuid'] ?? null, |
186 | 191 | ) |
187 | 192 | ); |
188 | 193 | $colMap[$column['id']] = $col->getId(); |
|
0 commit comments