Wiki: Error opening pages after update to beta 303

Created on 16 Sep 2019  路  2Comments  路  Source: Requarks/wiki

After the update when I updated from beta 275 to beta 303, when I open a page created with the old version I get the error "Expected unsigned integer at id, got 5,5". Also, when I try to access a page from the administration area I get a "An unexpected error occured."
Finally I can't create any new page because I get the error "GraphQL error: both cols and values must have same dimensions".

To Reproduce
Error on opening:

  1. Just access the page
    From administration area:
  2. Click on any row on the page list
    Create new page:
  3. Click on "New page" button in the upper right corner (the button is disabled)
  4. Click on the "Markdown" button
  5. Click "OK" on the Page Properties form
  6. Click on the "Create" button in the upper part of the screen

Expected behavior
Access the page and/or create new pages.

Host Info (please complete the following information):

  • OS: Ubuntu 18.04.3 LTS x64
  • Wiki.js version: 2.0.0-beta.303
  • Database engine: MS Sql Server 2017 14.0.3223.3 (x64)
under review

Most helpful comment

The problem seems to be that getPageFromDb() in \server\models\pages.js adds pages.* to the list of selected columns and a calling method now adds column pages.id, which causes MS SQL to return two columns both named id.

Replacing 'pages.*' with the following explicit list of columns seems to resolve the problem.

'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',

All 2 comments

The problem seems to be that getPageFromDb() in \server\models\pages.js adds pages.* to the list of selected columns and a calling method now adds column pages.id, which causes MS SQL to return two columns both named id.

Replacing 'pages.*' with the following explicit list of columns seems to resolve the problem.

'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',

It worked for me!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ramirahikkala picture ramirahikkala  路  3Comments

den1622 picture den1622  路  3Comments

ccolella-mdc picture ccolella-mdc  路  3Comments

leandro-hermes picture leandro-hermes  路  4Comments

bennycode picture bennycode  路  4Comments