Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
3c5352fb
Unverified
Commit
3c5352fb
authored
Jun 29, 2020
by
Seyed Sajad Kahani
Committed by
GitHub
Jun 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: change reconnectLink behavior for page move (#1991)
parent
370cd100
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
pages.js
server/models/pages.js
+9
-2
No files found.
server/models/pages.js
View file @
3c5352fb
...
...
@@ -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
=
`<a href="
${
prevPageHref
}
" class="is-internal-link is-
in
valid-page">`
replaceArgs
.
from
=
`<a href="
${
prevPageHref
}
" class="is-internal-link is-valid-page">`
replaceArgs
.
to
=
`<a href="
${
pageHref
}
" class="is-internal-link is-valid-page">`
break
case
'delete'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment