mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Fix attachment migration error about avatarUrl startsWith undefined.
Thanks to xet7 ! Related #4780
This commit is contained in:
parent
bf42958059
commit
7b2cff4c5e
1 changed files with 10 additions and 8 deletions
|
@ -1361,14 +1361,16 @@ Migrations.add('migrate-avatars-collectionFS-to-ostrioFiles', () => {
|
||||||
'original',
|
'original',
|
||||||
'/',
|
'/',
|
||||||
);
|
);
|
||||||
if (user.profile.avatarUrl.startsWith(old_url)) {
|
if (user.profile.avatarUrl !== undefined) {
|
||||||
// Set avatar url to new url
|
if (user.profile.avatarUrl.startsWith(old_url)) {
|
||||||
Users.direct.update(
|
// Set avatar url to new url
|
||||||
{ _id: user._id },
|
Users.direct.update(
|
||||||
{ $set: { 'profile.avatarUrl': new_url } },
|
{ _id: user._id },
|
||||||
noValidate,
|
{ $set: { 'profile.avatarUrl': new_url } },
|
||||||
);
|
noValidate,
|
||||||
console.log('User avatar updated: ', user._id, new_url);
|
);
|
||||||
|
console.log('User avatar updated: ', user._id, new_url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
fileObj.remove();
|
fileObj.remove();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue