Skip to content

Commit

Permalink
馃悰 Fixed error when rendering static page from dynamic route
Browse files Browse the repository at this point in the history
no issue

- When having following routes.yaml configuation and theme runing API v3:
routes:
  /:
    data: page.home
    template: home

- There was an internall error in meta layer: `Cannot read property 'website' of undefined` which was caused by not being able to read primary_author on a fetched page
- We need to include authors and tags for pages, the same way we do for posts to prevent this error (as they should have identical properties from meta layer perspective)
  • Loading branch information
naz committed Nov 25, 2019
1 parent f10a76e commit 1578204
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/frontend/services/routing/controllers/static.js
Expand Up @@ -11,7 +11,7 @@ function processQuery(query, locals) {
// the target resource. That means this static route has to behave the same way than the original resource url.
// e.g. the meta data package needs access to the full resource including relations.
// We override the `include` property for now, because the full data set is required anyway.
if (_.get(query, 'resource') === 'posts') {
if (_.get(query, 'resource') === 'posts' || _.get(query, 'resource') === 'pages') {
_.extend(query.options, {
include: 'authors,tags'
});
Expand Down

0 comments on commit 1578204

Please sign in to comment.