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

Fix bug where cloak doesn't generate any routes at all when CONTENTFUL_PREVIEW=true #57

Merged
merged 1 commit into from
May 3, 2022

Conversation

jonjahr
Copy link
Contributor

@jonjahr jonjahr commented May 3, 2022

I upgraded HFO to cloak ^1.15.3, and now the staging site doesn't generate any routes at all. I poked around and it looks like cloak/services/contentful.coffee uses the wrong token when it generates routes. (See screenshot below).

To solve this, I extracted the contentful token logic from cms.coffee and put it in a shared function so that contentful.coffee can use it too. Now when I test locally, craft generates the preview routes as intended. Maybe you have a better pattern in mind for doing this, but having a fix for this would be great.

…s/contentful.coffee can use it. Trying to fix bug where no routes were generated when CONTENTFUL_PREVIEW=true.
@jonjahr jonjahr requested a review from weotch May 3, 2022 21:00
@weotch weotch merged commit d2c4dc9 into master May 3, 2022
@weotch weotch deleted the update-contentful-access-token branch May 3, 2022 21:15
@weotch
Copy link
Member

weotch commented May 3, 2022

That woks for me! Tagged with /~https://github.com/BKWLD/cloak/releases/tag/v1.15.4

@jonjahr
Copy link
Contributor Author

jonjahr commented May 3, 2022

Thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants