diff --git a/server/models/pages.js b/server/models/pages.js
index 5689d6d2..37d0cc11 100644
--- a/server/models/pages.js
+++ b/server/models/pages.js
@@ -559,7 +559,7 @@ module.exports = class Page extends Model {
})
}
- // -> Reconnect Links
+ // -> Reconnect Links : Changing old links to the new path
await WIKI.models.pages.reconnectLinks({
sourceLocale: page.localeCode,
sourcePath: page.path,
@@ -567,6 +567,13 @@ module.exports = class Page extends Model {
path: opts.destinationPath,
mode: 'move'
})
+
+ // -> Reconnect Links : Validate invalid links to the new path
+ await WIKI.models.pages.reconnectLinks({
+ locale: opts.destinationLocale,
+ path: opts.destinationPath,
+ mode: 'create'
+ })
}
/**
@@ -655,7 +662,7 @@ module.exports = class Page extends Model {
break
case 'move':
const prevPageHref = `/${opts.sourceLocale}/${opts.sourcePath}`
- replaceArgs.from = ``
+ replaceArgs.from = ``
replaceArgs.to = ``
break
case 'delete':