Skip to content

Commit 8509054

Browse files
committed
feat: allow pages as privacy policy page (#8695eyy99)
1 parent 5baa3fa commit 8509054

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

app/back-end/builddata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"version": "0.46.0",
3-
"build": 16915
3+
"build": 16917
44
}

app/back-end/modules/render-html/helpers/gdpr.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ class Gdpr {
172172

173173
let result = renderer.cachedItems.posts[configuration.privacyPolicyPostId];
174174

175+
if (!result) {
176+
result = renderer.cachedItems.pages[configuration.privacyPolicyPostId];
177+
}
178+
175179
if (!result) {
176180
return '#not-found';
177181
}

app/src/components/Settings.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,7 +2369,9 @@ export default {
23692369
return sitemapLink;
23702370
},
23712371
postPages () {
2372-
return this.$store.state.currentSite.posts.filter(post => post.status.indexOf('published') > -1).map(post => post.id);
2372+
let posts = this.$store.state.currentSite.posts.filter(post => post.status.indexOf('published') > -1).map(post => post.id);
2373+
let pages = this.$store.state.currentSite.pages.filter(page => page.status.indexOf('published') > -1).map(page => page.id)
2374+
return posts.concat(pages);
23732375
},
23742376
dropdownItems () {
23752377
return [
@@ -2884,7 +2886,8 @@ export default {
28842886
}
28852887
},
28862888
customPostLabels (value) {
2887-
return this.$store.state.currentSite.posts.filter(post => post.id === value).map(post => post.title)[0];
2889+
let postsAndPages = this.$store.state.currentSite.posts.concat(this.$store.state.currentSite.pages);
2890+
return postsAndPages.filter(item => item.id === value).map(item => item.title)[0];
28882891
},
28892892
closeDropdown (refID) {
28902893
this.$refs[refID].isOpen = false;

0 commit comments

Comments
 (0)