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

Interactivity API: Rename data_wp_context function #59465

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

cbravobernal
Copy link
Contributor

@cbravobernal cbravobernal commented Feb 29, 2024

What?

Update Core blocks to be compatible with the refactor done in Core.

WordPress/wordpress-develop#6205

Why?

Check ticket: https://core.trac.wordpress.org/ticket/60575

Testing Instructions

Contexts should appear in Navigation and Search block.
These should work as expected.

Testing Instructions for Keyboard

Screenshots or screencast

@cbravobernal cbravobernal added [Type] Bug An existing feature does not function as intended Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta [Packages] Interactivity /packages/interactivity labels Feb 29, 2024
@cbravobernal cbravobernal self-assigned this Feb 29, 2024
Copy link

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/compat/wordpress-6.5/interactivity-api/interactivity-api.php

@swissspidy
Copy link
Member

Core change has been committed in https://core.trac.wordpress.org/changeset/57742

Copy link

github-actions bot commented Feb 29, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: c4rl0sbr4v0 <[email protected]>
Co-authored-by: DAreRodz <[email protected]>
Co-authored-by: swissspidy <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@cbravobernal
Copy link
Contributor Author

cbravobernal commented Feb 29, 2024

The sooner we merge, the fewer fatal errors there will be in Gutenberg + WP trunk! 😆

Copy link
Contributor

@DAreRodz DAreRodz left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@cbravobernal cbravobernal merged commit 7fa03fa into trunk Feb 29, 2024
67 of 68 checks passed
@cbravobernal cbravobernal deleted the refactor/rename_data_wp_context_function branch February 29, 2024 13:03
@github-actions github-actions bot added this to the Gutenberg 17.9 milestone Feb 29, 2024
@gziolo
Copy link
Member

gziolo commented Feb 29, 2024

@swissspidy, @youknowriad and @getdave, core blocks in WP core still use the old helper method which definitely breaks things. The best approach would be to publish npm packages with this commit and apply it WP core.

Alternatively, we can revert the commit, and try again next time we sync changes from Gutenberg.

@getdave
Copy link
Contributor

getdave commented Feb 29, 2024

The best approach would be to publish npm packages with this commit and apply it WP core.

We'll be publishing packages again on Tuesday prior to RC 1. How critical is it that we do another package update for this one change?

@swissspidy
Copy link
Member

@gziolo Right, of course! 🤦 Let me revert the core commit, that's the most straightforward way. Then we can introduce after the package update on Tuesday.

@swissspidy
Copy link
Member

Why the Gutenberg one? It has a compat copy in lib/compat/wordpress-6.5/interactivity-api/interactivity-api.php, no?

@cbravobernal
Copy link
Contributor Author

True, we don't

youknowriad pushed a commit that referenced this pull request Mar 4, 2024
Co-authored-by: c4rl0sbr4v0 <[email protected]>
Co-authored-by: DAreRodz <[email protected]>
Co-authored-by: swissspidy <[email protected]>
@youknowriad
Copy link
Contributor

I just cherry-picked this PR to the update/packages-6.5-rc1 branch to get it included in the next release.

@youknowriad youknowriad added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Mar 4, 2024
youknowriad pushed a commit that referenced this pull request Mar 4, 2024
Co-authored-by: c4rl0sbr4v0 <[email protected]>
Co-authored-by: DAreRodz <[email protected]>
Co-authored-by: swissspidy <[email protected]>
@georgestephanis
Copy link
Contributor

Is there a reason to not keep a copy of the old function in place with a _doing_it_wrong invocation and then calling the up-to-date function name, so that third-party plugins and themes that relied on the legacy function name don't fatal as it's suddenly undefined?

We just hit an issue of this bricking a site when Gutenberg updated to 17.9 as the function wasn't defined.

cbravobernal added a commit that referenced this pull request Mar 14, 2024
…59834)

* Re-introduce `data_wp_context()` with `_deprecated_function()` call

Following its removal in #59465 and release in Gutenberg 17.9, this can potentially result in fatal errors on sites where plugins or themes are calling `data_wp_context()` instead of the newer function name.

This should backfill it in, and provide a reminder to update to the newer function.

* Typo'd version number.



* Adding deprecated to phpdoc.



---------

Co-authored-by: georgestephanis <[email protected]>
Co-authored-by: c4rl0sbr4v0 <[email protected]>
carstingaxion pushed a commit to carstingaxion/gutenberg that referenced this pull request Mar 27, 2024
…ordPress#59834)

* Re-introduce `data_wp_context()` with `_deprecated_function()` call

Following its removal in WordPress#59465 and release in Gutenberg 17.9, this can potentially result in fatal errors on sites where plugins or themes are calling `data_wp_context()` instead of the newer function name.

This should backfill it in, and provide a reminder to update to the newer function.

* Typo'd version number.



* Adding deprecated to phpdoc.



---------

Co-authored-by: georgestephanis <[email protected]>
Co-authored-by: c4rl0sbr4v0 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported to WP Core Pull request that has been successfully merged into WP Core [Packages] Interactivity /packages/interactivity [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants