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

500/422 error on tags started with number and hyphen #6247

Closed
fengkaijia opened this issue Dec 19, 2015 · 2 comments · Fixed by #6251
Closed

500/422 error on tags started with number and hyphen #6247

fengkaijia opened this issue Dec 19, 2015 · 2 comments · Fixed by #6251
Assignees
Labels
affects:api Affects the Ghost API bug [triage] something behaving unexpectedly

Comments

@fengkaijia
Copy link

After 0.7.1 (which worked), when accessing the page of a tag begin with number and a hyphen, whatever the tag exist or not, for example: https://example.com/tag/2016-election/ a 500 (or 422 using the Ghost demo) error is returned:

Parse error on line 1:
tags:2016-election
---------^
Expecting 'OR', 'AND', 'RPAREN', 'RBRACKET', got 'NOT'

When there's no hyphen, everything worked. For example https://example.com/tag/24hour/ And after remove the number and hyphen part, everything works again.

@ErisDS
Copy link
Member

ErisDS commented Dec 19, 2015

@fengkaijia, thanks for the clear bug report. I've seen this error a couple of times and not known what was causing it, the only way I could reproduce was with badly formatted API calls. Now I know the cause I should be able to get it fixed up pretty quickly.

@ErisDS ErisDS added bug [triage] something behaving unexpectedly affects:api Affects the Ghost API labels Dec 19, 2015
@ErisDS ErisDS self-assigned this Dec 19, 2015
ErisDS added a commit to ErisDS/Ghost that referenced this issue Dec 20, 2015
fixes TryGhost#6247

- GQL has a bug where literals starting with numbers are incorrectly parsed
- Using strings instead of literals is a workaround, but is probably safer anyway
@ErisDS
Copy link
Member

ErisDS commented Dec 20, 2015

I've got a PR in for a quick fix. The underlying issue is the same as this: TryGhost/GQL#3 and is going to require a bit of a redesign of GQL's lexer, I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:api Affects the Ghost API bug [triage] something behaving unexpectedly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants