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: unable to load documents with non-standard ids #9407

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

JarrodMFlesch
Copy link
Contributor

@JarrodMFlesch JarrodMFlesch commented Nov 21, 2024

What?

Non-standard ids caused an issue when finding the document on the server.

This is an odd regression, in 2.0 we were fetching the document on the client so the request would handle decoding the url. Now we are fetching the document on the server and need to do this manually when reading id from route params.

Why?

The slug pulled out of the url for an id of id 1 would equate to id%201 which would fail in the payload.find call since there is not an id stored as id%201 but instead id 1.

How?

Wherever we are calling payload.find in the views and querying by id it gets ran through a helper function that decodes it properly.

Fixes #9373

@JarrodMFlesch JarrodMFlesch merged commit ee1a91e into main Nov 21, 2024
52 checks passed
@JarrodMFlesch JarrodMFlesch deleted the fix/sanitize-id branch November 21, 2024 19:16
Copy link

🚀 This is included in version v3.1.0

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

Successfully merging this pull request may close these issues.

id is not URI decoded before lookup
1 participant