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

Second round of package updates for 6.3 RC3 #4946

Conversation

tellthemachines
Copy link
Contributor

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

Package updates with bug fixes listed here: WordPress/gutenberg#53210


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.

@tellthemachines
Copy link
Contributor Author

Testing in local env shows all fixes working as expected ✅

@spacedmonkey
Copy link
Member

Left some feedback

Copy link
Member

@spacedmonkey spacedmonkey left a comment

Choose a reason for hiding this comment

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

Left some feedback.

*
* @param int|array $autosave The autosave ID or array.
*/
function _wp_rest_api_autosave_meta( $autosave ) {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of doing this, can we not just change the autosave endpoint?

Copy link
Member

Choose a reason for hiding this comment

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

Override the autosave endpoint? It's an option, I wasn't sure if it's too big of a change too late in the cycle.

Copy link
Member

Choose a reason for hiding this comment

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

Using hooks felt to me like a more isolated temporary solution while we wait for general meta support. I'm not sure how I feel about hardcoding updating footnotes meta into the endpoint. Or do you mean filtering/overriding the autosave controller from this file? Might also be more prone to breakage if someone changes the controller?

* See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L365-L384.
* See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L219.
*/
function _wp_rest_api_force_autosave_difference( $prepared_post, $request ) {
Copy link
Member

Choose a reason for hiding this comment

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

This feels a little hacky.

Copy link
Member

Choose a reason for hiding this comment

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

Well, it is a hack! 😄

Copy link
Member

Choose a reason for hiding this comment

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

In the original PR I've wondered wether we really want to include this fix. This is only needed for previewing published posts when footnotes meta changes, but the rest of the post content does not.

WordPress/gutenberg#53072 (comment)

@tellthemachines
Copy link
Contributor Author

Thanks for the feedback @spacedmonkey ! While @ellatrix might be better positioned to answer those questions, my take on it is that this is a temporary patch until revisions work properly for post meta, and necessary for footnotes to work seamlessly in 6.3. There's a bit more discussion on the original PR.

We're hours away from RC3 and it's important that these fixes go in, so I'm going to go ahead and commit this changeset to trunk as it's EOD for me. It will still require second committer review though so I'll leave it in the release channel for folks to deal with.

@audrasjb
Copy link
Contributor

audrasjb commented Aug 1, 2023

Yes, it makes sense to me to not introduce a bigger change 👍

@audrasjb
Copy link
Contributor

audrasjb commented Aug 1, 2023

@audrasjb audrasjb closed this Aug 1, 2023
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.

4 participants