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

QuickEdit: prevent site-editor from crashing when slug is not an object #67577

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Dec 4, 2024

Related #66599 #66559

What?

This fixes a hidden bug: in some situations, the data received by slug is not an object.

How?

We've covered against that in the view, but didn't in the edit control. I've moved the check in the view to within the getSlug util, so it covers all the cases.

Testing Instructions

  • Modify this line to type: 'regular'.
  • Go to Site Editor > Pages, switch to table and open the QuickEdit experiment.
  • Verify that it loads:
Screenshot 2024-12-04 at 14 26 02

@oandregal oandregal requested a review from gigitux December 4, 2024 13:26
@oandregal oandregal self-assigned this Dec 4, 2024
@oandregal oandregal added [Type] Bug An existing feature does not function as intended [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Dec 4, 2024
Copy link

github-actions bot commented Dec 4, 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: oandregal <oandregal@git.wordpress.org>
Co-authored-by: gigitux <gigitux@git.wordpress.org>

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

Copy link
Contributor

@gigitux gigitux 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 this fix! We need to revisit how loading state is handled #66599

@oandregal oandregal enabled auto-merge (squash) December 4, 2024 13:35
Copy link

github-actions bot commented Dec 4, 2024

Flaky tests detected in be60beb.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12160720026
📝 Reported issues:

@oandregal oandregal merged commit 532b8e2 into trunk Dec 4, 2024
68 of 70 checks passed
@oandregal oandregal deleted the fix/slug-utils branch December 4, 2024 14:02
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Dec 4, 2024
michalczaplinski pushed a commit that referenced this pull request Dec 5, 2024
…ct (#67577)

Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: gigitux <gigitux@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [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