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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰Fixed auto redirect for extra data queries on post and page resources #9828
Conversation
We'll merge this next week. Want to test again. @gargol want's to look at it and learn it 馃憤 |
8faeb46
to
2c776dd
Compare
2c776dd
to
abc793a
Compare
@gargol Ready to review |
Added reminder to review this first thing on Monday (October 1st), sorry for a drag 馃 |
@gargol 馃槑 |
The fix for redirect works in short-form scenarios e.g: Have noticed another inconsistency when trying to define a custom route through longform like so:
gave me:
It makes sense, but maybe we should allow |
Do you mean this? |
Hmm it is inconsistent yes, but i think it's logical? We could maybe allow this for "routes" directive, BUT for collections you can't define pages. You can't have a collection of pages. |
Will look into this 馃憤 |
closes TryGhost#9791 - we only made use of the redirect middleware, who detects if a redirect should happen, for taxonomies (tags, authors) - `data: page.team` will now redirect too - `data: post.team` will now redirect too - you can disable the redirect using the longform
Now that v2 exists and we have added This will work for v0.1:
This will work for v2:
I've committed some smaller changes to make both versions working 馃憤 |
abc793a
to
f6700f7
Compare
@gargol This has priority for Monday. |
Just some observations for the usages form comment above. In v1, this route:
does not respect The redirect: http://ghost.local/team/ -> http://ghost.local/about/team/ - works 馃憤 |
When creating a long-form route (for v2) like:
The variable name Also when trying to turn off the redirect in long-form:
it still keeps redirecting http://ghost.local/team/ -> http://ghost.local/about/team/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found couple more bugs explained in general PR comments.
This |
Can't reproduce. Works for me. |
Can't reproduce neither. |
@gargol Could you pls double check? I want to merge this PR asap 馃憤 |
Confirming I was wrong about both bugs. Don't know how this was happening:
But the redirect didn't work in Chrome due to caching. When trying it out in incognito everything just worked. @kirrg001 I think I've exausted the amount of testing and reviews that can be done here 馃槅 please 馃殺 this when ready |
* master: Version bump to 2.7.0 Updated Ghost-Admin to 2.7.0 馃悰 Fixed contributors being able to delete draft posts as co-author (#10239) Added configuration controller to v2 API (#10056) 馃悰 Fixed site changed webhook not triggered for scheduled posts 馃悰 Fixed invalid imported subscribers count (#10229) 馃悰Fixed auto redirect for extra data queries on post and page resources (#9828) Included relations if static resource is post | page (#10148) Renamed API -> Api for v2 auth logic (#10142) 馃悰Removed user reference warning from importer report if post is a draft (#10169) 馃悰 Fixed edit permission of the common article by multiple authors (#10214) Updated npm keywords (#10217)
* master: Version bump to 2.7.1 Updated Ghost-Admin to 2.7.1 Version bump to 2.7.0 Updated Ghost-Admin to 2.7.0 馃悰 Fixed contributors being able to delete draft posts as co-author (#10239) Added configuration controller to v2 API (#10056) 馃悰 Fixed site changed webhook not triggered for scheduled posts 馃悰 Fixed invalid imported subscribers count (#10229) 馃悰Fixed auto redirect for extra data queries on post and page resources (#9828) Included relations if static resource is post | page (#10148) Renamed API -> Api for v2 auth logic (#10142) 馃悰Removed user reference warning from importer report if post is a draft (#10169) 馃悰 Fixed edit permission of the common article by multiple authors (#10214) Updated npm keywords (#10217)
closes #9791
data: page.team
will now redirect toodata: post.team
will now redirect too