Fixed Error in migrate-lists-to-per-swimlane migration.

Thanks to xet7 !

Fixes #5918
This commit is contained in:
Lauri Ojansivu 2025-10-13 20:34:23 +03:00
parent 9bd21e1d1b
commit cc99da5357
9 changed files with 157 additions and 135 deletions

View file

@ -40,7 +40,7 @@ if (Meteor.isServer) {
}
}
storagePath = path.join(process.env.WRITABLE_PATH, 'attachments');
storagePath = path.join(process.env.WRITABLE_PATH || process.cwd(), 'attachments');
}
export const fileStoreStrategyFactory = new FileStoreStrategyFactory(AttachmentStoreStrategyFilesystem, storagePath, AttachmentStoreStrategyGridFs, attachmentBucket);

View file

@ -40,7 +40,7 @@ if (Meteor.isServer) {
}
avatarsBucket = createBucket('avatars');
storagePath = path.join(process.env.WRITABLE_PATH, 'avatars');
storagePath = path.join(process.env.WRITABLE_PATH || process.cwd(), 'avatars');
}
const fileStoreStrategyFactory = new FileStoreStrategyFactory(FileStoreStrategyFilesystem, storagePath, FileStoreStrategyGridFs, avatarsBucket);

View file

@ -1148,13 +1148,13 @@ Boards.helpers({
permission: this.permission,
members: this.members,
color: this.color,
description: TAPi18n.__('default-subtasks-board', {
description: TAPi18n && TAPi18n.i18n ? TAPi18n.__('default-subtasks-board', {
board: this.title,
}),
}) : `Default subtasks board for ${this.title}`,
});
Swimlanes.insert({
title: TAPi18n.__('default'),
title: TAPi18n && TAPi18n.i18n ? TAPi18n.__('default') : 'Default',
boardId: this.subtasksDefaultBoardId,
});
Boards.update(this._id, {
@ -1181,13 +1181,13 @@ Boards.helpers({
permission: this.permission,
members: this.members,
color: this.color,
description: TAPi18n.__('default-dates-board', {
description: TAPi18n && TAPi18n.i18n ? TAPi18n.__('default-dates-board', {
board: this.title,
}),
}) : `Default dates board for ${this.title}`,
});
Swimlanes.insert({
title: TAPi18n.__('default'),
title: TAPi18n && TAPi18n.i18n ? TAPi18n.__('default') : 'Default',
boardId: this.dateSettingsDefaultBoardId,
});
Boards.update(this._id, {
@ -1209,7 +1209,7 @@ Boards.helpers({
this.subtasksDefaultListId === undefined
) {
this.subtasksDefaultListId = Lists.insert({
title: TAPi18n.__('queue'),
title: TAPi18n && TAPi18n.i18n ? TAPi18n.__('queue') : 'Queue',
boardId: this._id,
swimlaneId: this.getDefaultSwimline()._id, // Set default swimlane for subtasks list
});
@ -1228,7 +1228,7 @@ Boards.helpers({
this.dateSettingsDefaultListId === undefined
) {
this.dateSettingsDefaultListId = Lists.insert({
title: TAPi18n.__('queue'),
title: TAPi18n && TAPi18n.i18n ? TAPi18n.__('queue') : 'Queue',
boardId: this._id,
swimlaneId: this.getDefaultSwimline()._id, // Set default swimlane for date settings list
});
@ -1244,8 +1244,10 @@ Boards.helpers({
getDefaultSwimline() {
let result = ReactiveCache.getSwimlane({ boardId: this._id });
if (result === undefined) {
// Use fallback title if i18n is not available (e.g., during migration)
const title = TAPi18n && TAPi18n.i18n ? TAPi18n.__('default') : 'Default';
Swimlanes.insert({
title: TAPi18n.__('default'),
title: title,
boardId: this._id,
});
result = ReactiveCache.getSwimlane({ boardId: this._id });
@ -2212,7 +2214,7 @@ if (Meteor.isServer) {
migrationVersion: 1, // Latest version - no migration needed
});
const swimlaneId = Swimlanes.insert({
title: TAPi18n.__('default'),
title: TAPi18n && TAPi18n.i18n ? TAPi18n.__('default') : 'Default',
boardId: id,
});
JsonRoutes.sendResult(res, {

View file

@ -2138,7 +2138,7 @@ if (Meteor.isServer) {
const future3 = new Future();
Boards.insert(
{
title: TAPi18n.__('templates'),
title: TAPi18n && TAPi18n.i18n ? TAPi18n.__('templates') : 'Templates',
permission: 'private',
type: 'template-container',
},
@ -2154,7 +2154,7 @@ if (Meteor.isServer) {
// Insert the card templates swimlane
Swimlanes.insert(
{
title: TAPi18n.__('card-templates-swimlane'),
title: TAPi18n && TAPi18n.i18n ? TAPi18n.__('card-templates-swimlane') : 'Card Templates',
boardId,
sort: 1,
type: 'template-container',
@ -2174,7 +2174,7 @@ if (Meteor.isServer) {
// Insert the list templates swimlane
Swimlanes.insert(
{
title: TAPi18n.__('list-templates-swimlane'),
title: TAPi18n && TAPi18n.i18n ? TAPi18n.__('list-templates-swimlane') : 'List Templates',
boardId,
sort: 2,
type: 'template-container',
@ -2194,7 +2194,7 @@ if (Meteor.isServer) {
// Insert the board templates swimlane
Swimlanes.insert(
{
title: TAPi18n.__('board-templates-swimlane'),
title: TAPi18n && TAPi18n.i18n ? TAPi18n.__('board-templates-swimlane') : 'Board Templates',
boardId,
sort: 3,
type: 'template-container',