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: Fix context inheritance from namespaces different than the current one #64677

Merged
merged 3 commits into from
Aug 21, 2024

Conversation

DAreRodz
Copy link
Contributor

What?

Fixes a bug introduced in the recent refactoring of the Interactivity API internals (see #62734). Noticed while merging trunk in #62906.

Why?

The data-wp-context directive stopped propagating values from parent contexts using a different namespace. This broke directives trying to access values from such contexts.

Testing Instructions

These changes can be tested on top of the #62906 PR.

To reproduce the issue:

  1. Checkout Gallery: Add lightbox support #62906 locally.
  2. Merge trunk in the current branch.
  3. Create a gallery on your test site with a couple of images.
  4. Select "Expand on click" for each image.
  5. Visit the page with the gallery.
  6. When you expand an image, the buttons to navigate to the next and previous images don't appear.

To check the issue is fixed:

  1. Checkout Gallery: Add lightbox support #62906 locally.
  2. Merge this PR's branch in the current branch.
  3. Follow steps 3 to 5 from the list above.
  4. When you expand an image, the buttons to navigate to the next and previous images should appear.

@DAreRodz DAreRodz added [Type] Bug An existing feature does not function as intended [Feature] Interactivity API API to add frontend interactivity to blocks. [Packages] Interactivity /packages/interactivity labels Aug 21, 2024
@DAreRodz DAreRodz self-assigned this Aug 21, 2024
@DAreRodz DAreRodz changed the title Fix/iapi context inheritance Interactivity API: Fix context inheritance from different namespaces than the current one Aug 21, 2024
@DAreRodz DAreRodz changed the title Interactivity API: Fix context inheritance from different namespaces than the current one Interactivity API: Fix context inheritance from namespaces different than the current one Aug 21, 2024
@DAreRodz DAreRodz marked this pull request as ready for review August 21, 2024 09:45
Copy link

github-actions bot commented Aug 21, 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: DAreRodz <[email protected]>
Co-authored-by: luisherranz <[email protected]>

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

Copy link
Member

@luisherranz luisherranz left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix David.

@luisherranz luisherranz enabled auto-merge (squash) August 21, 2024 10:10
@luisherranz luisherranz merged commit 5fb9c1c into trunk Aug 21, 2024
67 checks passed
@luisherranz luisherranz deleted the fix/iapi-context-inheritance branch August 21, 2024 10:20
@github-actions github-actions bot added this to the Gutenberg 19.1 milestone Aug 21, 2024
samueljseay pushed a commit to woocommerce/woocommerce that referenced this pull request Aug 21, 2024
bph pushed a commit to bph/gutenberg that referenced this pull request Aug 31, 2024
…than the current one (WordPress#64677)

* Add failing test

* Fix contextStack generation to include other namespaces

* Update changelog

Co-authored-by: DAreRodz <[email protected]>
Co-authored-by: luisherranz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Interactivity API API to add frontend interactivity to blocks. [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.

2 participants