From df4137d507e6bf270eeac3b8a8cdbe8f39a0b691 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Mon, 28 Aug 2023 07:54:31 +0200 Subject: [PATCH 1/2] fix(org): SSR config --- sites/org/pages/account/[platform].mjs | 2 +- sites/org/pages/account/apikeys/[id].mjs | 2 +- sites/org/pages/account/bookmarks/[id].mjs | 2 +- sites/org/pages/account/sets/[id].mjs | 2 +- sites/org/pages/docs/[...slug].mjs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sites/org/pages/account/[platform].mjs b/sites/org/pages/account/[platform].mjs index b811f3977da..a47580ec167 100644 --- a/sites/org/pages/account/[platform].mjs +++ b/sites/org/pages/account/[platform].mjs @@ -80,5 +80,5 @@ export const getStaticPaths = async () => { } } - return { paths, fallback: false } + return { paths, fallback: true } } diff --git a/sites/org/pages/account/apikeys/[id].mjs b/sites/org/pages/account/apikeys/[id].mjs index 2c3449240be..215eb98de71 100644 --- a/sites/org/pages/account/apikeys/[id].mjs +++ b/sites/org/pages/account/apikeys/[id].mjs @@ -85,4 +85,4 @@ export async function getStaticProps({ locale, params }) { * this page should be used to generate the result. * To learn more, see: https://nextjs.org/docs/basic-features/data-fetching */ -export const getStaticPaths = async () => ({ paths: [], fallback: false }) +export const getStaticPaths = async () => ({ paths: [], fallback: true }) diff --git a/sites/org/pages/account/bookmarks/[id].mjs b/sites/org/pages/account/bookmarks/[id].mjs index 0fbaca365e9..c5a43eee48f 100644 --- a/sites/org/pages/account/bookmarks/[id].mjs +++ b/sites/org/pages/account/bookmarks/[id].mjs @@ -84,4 +84,4 @@ export async function getStaticProps({ locale, params }) { * this page should be used to generate the result. * To learn more, see: https://nextjs.org/docs/basic-features/data-fetching */ -export const getStaticPaths = async () => ({ paths: [], fallback: false }) +export const getStaticPaths = async () => ({ paths: [], fallback: true }) diff --git a/sites/org/pages/account/sets/[id].mjs b/sites/org/pages/account/sets/[id].mjs index e4dcf13c7e6..bf9302391af 100644 --- a/sites/org/pages/account/sets/[id].mjs +++ b/sites/org/pages/account/sets/[id].mjs @@ -64,4 +64,4 @@ export async function getStaticProps({ locale, params }) { * this page should be used to generate the result. * To learn more, see: https://nextjs.org/docs/basic-features/data-fetching */ -export const getStaticPaths = async () => ({ paths: [], fallback: false }) +export const getStaticPaths = async () => ({ paths: [], fallback: true }) diff --git a/sites/org/pages/docs/[...slug].mjs b/sites/org/pages/docs/[...slug].mjs index c4a69dd90e3..453e54dbef2 100644 --- a/sites/org/pages/docs/[...slug].mjs +++ b/sites/org/pages/docs/[...slug].mjs @@ -84,6 +84,6 @@ export async function getStaticPaths() { ...somePaths.map((key) => `/nl/${key}`), ...somePaths.map((key) => `/uk/${key}`), ], - fallback: false, + fallback: true, } } From 6523688991f8d54558f97d8ced0d44ad0e045a86 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Mon, 28 Aug 2023 08:01:00 +0200 Subject: [PATCH 2/2] fix(backend): Handle units and newsletter on import. Closes #4834 --- sites/backend/src/models/user.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sites/backend/src/models/user.mjs b/sites/backend/src/models/user.mjs index f744e4f6b03..e07590bd0ee 100644 --- a/sites/backend/src/models/user.mjs +++ b/sites/backend/src/models/user.mjs @@ -1642,12 +1642,12 @@ const migrateUser = (v2) => { ihash: hash(initial), img: 'default-avatar', initial, - imperial: v2.units === 'imperial', + imperial: v2.settings.units === 'imperial', language: v2.settings.language, lastSeen: new Date(), lusername: v2.username.toLowerCase(), mfaEnabled: false, - newsletter: false, + newsletter: v2.newsletter === true ? true : false, patron: v2.patron, role: v2._id === '5d62aa44ce141a3b816a3dd9' ? 'admin' : 'user', status: v2.status === 'active' ? 1 : 0,