Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data: post.slug breaks meta layer on index collection page #10542

Closed
kirrg001 opened this issue Feb 26, 2019 · 7 comments · Fixed by #10718
Closed

data: post.slug breaks meta layer on index collection page #10542

kirrg001 opened this issue Feb 26, 2019 · 7 comments · Fixed by #10718
Assignees
Labels
affects:routing related to the url service & dynamic routing features bug [triage] something behaving unexpectedly server / core Issues relating to the server or core of Ghost

Comments

@kirrg001
Copy link
Contributor

kirrg001 commented Feb 26, 2019

Steps to reproduce:

collections:
  /blog/:
     permalink: /blog/{slug}/
     data: post.known

Serve /blog/. See error in stdout

MESSAGE: Cannot read property 'name' of null

TypeError: Cannot read property 'name' of null
    at getPostSchema (/ghost/ghost-workspace2/core/server/data/meta/schema.js:82:61)
@kirrg001 kirrg001 added bug [triage] something behaving unexpectedly server / core Issues relating to the server or core of Ghost affects:routing related to the url service & dynamic routing features labels Feb 26, 2019
@naz naz self-assigned this Apr 29, 2019
@naz
Copy link
Contributor

naz commented Apr 29, 2019

@kirrg001 wasn't able to reproduce this one. Used following configuration for collections:

collections:
  /blog/:
     permalink: /blog/{slug}/
     data: post.unknown

Both http://ghost.local/blog/ and http://ghost.local/blog/cant-find-me returned regular 404 with no additional errors in the output. Maybe there are some additional steps I'm missing?

@naz naz removed their assignment Apr 29, 2019
@kirrg001
Copy link
Contributor Author

Did you try a known post slug?

@naz
Copy link
Contributor

naz commented Apr 29, 2019

Tried following. Published post renders normally: http://ghost.local/just-a-page/ , and when going to http://ghost.local/blog/just-a-page/ it renders a 404 like above.

@kirrg001
Copy link
Contributor Author

kirrg001 commented Apr 29, 2019

collections:
  /blog/:
     permalink: /blog/{slug}/
     data: post.known

Serve /blog/ reproduces the problem.

@kirrg001 kirrg001 changed the title data: post.slug breaks meta layer if post was not found data: post.slug breaks meta layer on index collection page Apr 29, 2019
@naz
Copy link
Contributor

naz commented Apr 29, 2019

What do you have in permalink where .. is?

@kirrg001
Copy link
Contributor Author

Updated

@naz
Copy link
Contributor

naz commented Apr 29, 2019

Are there any other configurations in the routes.yml you are using? Can't get this error happening on my machine. Created a post with known tag and collections config like above and it works when opening http://ghost.local/blog/known/ and 404 is rendered when visiting http://ghost.local/blog/.
Is the theme you are testing on v0.1 by any chance?

@naz naz self-assigned this Apr 29, 2019
naz added a commit to naz/Ghost that referenced this issue Apr 30, 2019
closes TryGhost#10542

- Fixed error that was causing collection index to not be rendered: relations connected to alliased resource were not fetched
naz added a commit that referenced this issue Apr 30, 2019
closes #10542

- Fixed error that was causing collection index to not be rendered: relations connected to alliased resource were not fetched
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:routing related to the url service & dynamic routing features bug [triage] something behaving unexpectedly server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants