fix(restore): accept originals paths in group photos
- validate group_photos.photo_original_path with the same tolerant helper as entries, so /uploads/.originals/<file> no longer fails restore with "Invalid upload path" - accept legacy flat values in both photo_original_path columns - preserve users.avatar in normalizeRestoreData and the restore INSERT - add selftests for originals paths and avatars
This commit is contained in:
@@ -6246,8 +6246,8 @@ app.post('/api/restore', requireAdmin, backupUploadGuard, uploadBackup.single('b
|
||||
}
|
||||
for (const x of ndata.users) {
|
||||
await client.query(
|
||||
'INSERT INTO users (id, username, password_hash, name, role, is_active, created_at) VALUES ($1,$2,$3,$4,$5,$6,$7)',
|
||||
[x.id, x.username, x.password_hash, x.name, x.role, x.is_active, x.created_at]
|
||||
'INSERT INTO users (id, username, password_hash, name, avatar, role, is_active, created_at) VALUES ($1,$2,$3,$4,$5,$6,$7,$8)',
|
||||
[x.id, x.username, x.password_hash, x.name, x.avatar, x.role, x.is_active, x.created_at]
|
||||
);
|
||||
}
|
||||
for (const x of (ndata.user_settings || [])) {
|
||||
|
||||
Reference in New Issue
Block a user