Ver Fonte

fix: MSSQL - expand pages.* to prevent duplicate columns (#1126)

* Expand pages.* to prevent duplicate columns in MSSQL

Replace pages.* in select query with explicit list of columns to avoid multiple identically named columns being returned by MSSQL

* Use global replace for analytics header templates

Replace multiple instances of the same template variable in analytics templates

* Revert "Use global replace for analytics header templates"

This reverts commit 290b53b6e33c45d358252a14c838d12916895601.
Phil Cullen há 5 anos atrás
pai
commit
ea5c4ea33d
1 ficheiros alterados com 20 adições e 1 exclusões
  1. 20 1
      server/models/pages.js

+ 20 - 1
server/models/pages.js

@@ -675,7 +675,26 @@ module.exports = class Page extends Model {
     try {
     try {
       return WIKI.models.pages.query()
       return WIKI.models.pages.query()
         .column([
         .column([
-          'pages.*',
+          'pages.id',
+          'pages.path',
+          'pages.hash',
+          'pages.title',
+          'pages.description',
+          'pages.isPrivate',
+          'pages.isPublished',
+          'pages.privateNS',
+          'pages.publishStartDate',
+          'pages.publishEndDate',
+          'pages.content',
+          'pages.render',
+          'pages.toc',
+          'pages.contentType',
+          'pages.createdAt',
+          'pages.updatedAt',
+          'pages.editorKey',
+          'pages.localeCode',
+          'pages.authorId',
+          'pages.creatorId',
           {
           {
             authorName: 'author.name',
             authorName: 'author.name',
             authorEmail: 'author.email',
             authorEmail: 'author.email',