Skip to content

Backport - Navigation fallbacks#4648

Closed
getdave wants to merge 15 commits intoWordPress:trunkfrom
getdave:backport/navigation-fallbacks
Closed

Backport - Navigation fallbacks#4648
getdave wants to merge 15 commits intoWordPress:trunkfrom
getdave:backport/navigation-fallbacks

Conversation

@getdave
Copy link
Copy Markdown
Contributor

@getdave getdave commented Jun 20, 2023

Adds files relating to Navigation fallbacks for the block editor.

Trac ticket: https://core.trac.wordpress.org/ticket/58557


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@getdave getdave marked this pull request as draft June 20, 2023 13:03
@spacedmonkey
Copy link
Copy Markdown
Member

@getdave Friendly reminder, changes like this need unit tests. Please ensure to backport / add unit tests.

@spacedmonkey spacedmonkey self-requested a review June 20, 2023 13:05
@getdave

This comment was marked as resolved.

@spacedmonkey
Copy link
Copy Markdown
Member

All classes, methods and function will need a @since 6.3.0.

@getdave
Copy link
Copy Markdown
Contributor Author

getdave commented Jun 20, 2023

@getdave Friendly reminder, changes like this need unit tests. Please ensure to backport / add unit tests.

Yep thanks. We have a suite already and I'm working out how/where to port them now.

I'm also trying to work out whether this filter makes sense or if there is a centralise point of registration of schemas in Core where I can just inline this.



/**
* @covers WP_REST_Navigation_Fallback_Controller::get_fallback
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unit tests need a ticket number of them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

...a ticket number of them

I'm not sure what a "ticket number" is. Can you advise further?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the context.

Use @ticket 12345 to indicate that a test addresses the bug described in ticket...

I read that and I was slightly confused because these files do not fix a bug. However, I assume this is some convention by way that when a backport is introduced we tag the Trac ticket to the test where it was introduced?

If I've got that wrong please do let me know.

Copy link
Copy Markdown
Contributor

@audrasjb audrasjb left a comment

Choose a reason for hiding this comment

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

I added some docblock related comments.
We can of course fix these small nitpick issues once it's committed, but still better to do it before committing the feature if possible.
I can update the PR accordingly if needed, just let me know.

@getdave
Copy link
Copy Markdown
Contributor Author

getdave commented Jun 26, 2023

Looks like I need to add a new mock here 🤔

@ramonjd
Copy link
Copy Markdown
Member

ramonjd commented Jun 27, 2023

I think maybe we just need to regenerate qunit/fixtures/wp-api-generated.js?

npm run test:php -- --filter WP_Test_REST_Schema_Initialization

I'll take a look

Edit: trying over here: #4713

Sorry I would have committed to this branch but I have a cheap account 😄

@ramonjd
Copy link
Copy Markdown
Member

ramonjd commented Jun 27, 2023

With the updated fixtures in #4713

LGTM

I'll have this one closed in favour of #4713 and assign @getdave props

Thanks again, everyone!

@getsource
Copy link
Copy Markdown
Member

Thank you!!

@tellthemachines
Copy link
Copy Markdown
Contributor

Closing in favour of #4713

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.

6 participants