Reputation: 2321
I have a page that uses a hierarchical viewer with a content filter that filters on two page types, one a container and the other a leaf page. The container page type has no fields, the page does have several fields. In Hierarchical Viewer/Content Filter/Columns I list a few columns explicitly to return, as this helps performance.
We are upgrading from Kentico 8.2 to Kentico 9. In the 8.2 site, this page is working. In the 9 site, it is now throwing an exception saying "Invalid column name". If I remove the column list (allowing Kentico to return all columns by default), it works again. The performance hit isn't very noticeable, so this is a viable option. However, I'd like to know why this isn't working now in Kentico 9.
It seems like when returning all columns, by default, if a column isn't available on a page type, Kentico generates SELECT null as MissingColumnName
, but when explicitly listing the columns to return, it generates SELECT MissingColumnName
. I don't know if this is a change between Kentico 8.2 and 9, or if something got changed during the upgrade.
Upvotes: 0
Views: 199
Reputation: 6117
Pre version 9, Kentico created specific views for each page type. These views were used in the queries to retrieve page information. The views joined the node, document and custom page type information into one query. In v9 these views were removed and a generic view was added which only joins the node and document information together, then dynamically adds the custom page type information after.
So the short answer is the API changed significantly for the pages and how data is retrieved so this is an expected breaking change. Your solution is not the best solution since it returns all the columns. BUT it would be the quick, easy fix. I'd suggest adding in some caching on the webpart which will help performance greatly which is what we do for situations like this in v9 and newer sites.
Upvotes: 2