Skip to content

Conversation

@jasonbahl
Copy link
Collaborator

@jasonbahl jasonbahl commented Dec 6, 2024

What does this implement/fix? Explain your changes.

This fixes a bug where entering a uri for an invalid node might return a node with a different uri.

Does this close any currently open issues?

Closes #3240

With this PR in place, following the same steps to reproduce (as documented in #3240):

Before

Querying for a node by uri might return a node that has a different uri.

CleanShot 2024-12-05 at 16 43 44

After

Now, querying for a node using a uri that would 404 in traditional WP will return a null instead of returning a node that doesn't match the uri input.

CleanShot 2024-12-05 at 16 42 24

And querying with the correct uri continues to return the expected node:

CleanShot 2024-12-05 at 16 47 42

…w a 404, unless there are $extra_query_vars (used to query by slug, id, etc)
Copy link
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of extra class props and deviating further from core in methods like ::parse_request(), i'd recommend we implement a register_globals() and handle_404() method.

That's significantly more work though.

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit e901a2f and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link

Coverage Status

coverage: 83.977% (+0.009%) from 83.968%
when pulling e901a2f on fix/3240-uri-query-bug
into 948d4e3 on develop.

@jasonbahl jasonbahl merged commit 739845b into develop Dec 9, 2024
34 checks passed
@justlevine justlevine deleted the fix/3240-uri-query-bug branch December 28, 2024 22:40
@jasonbahl jasonbahl mentioned this pull request Jan 16, 2025
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.

URI Query - Receiving Post for Incorrect Slug Path

4 participants