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

Quality: fix php warning error #61321

Merged
merged 2 commits into from
May 2, 2024
Merged

Quality: fix php warning error #61321

merged 2 commits into from
May 2, 2024

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented May 2, 2024

Follow up #61080

Props to @Mamaduka for discovering the problem with [this comment]

What?

This PR fixes a warning about undefined $submenu global variable.

Why?

I was initially unable to reproduce this issue in the dashboard. However, for example, I noticed that this warning log is recorded when entering a keyword on the plugin page, that is, when an Ajax request is made.

I'm a little unsure, but I suspect that $submenu will be undefined in certain situations.

Testing Instructions

  • On the plugin search page, enter any keywords to update the list.
  • No warning logs should be logged.

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels May 2, 2024
@t-hamano t-hamano self-assigned this May 2, 2024
@t-hamano t-hamano requested a review from Mamaduka May 2, 2024 12:03
@t-hamano t-hamano marked this pull request as ready for review May 2, 2024 12:03
@t-hamano t-hamano requested a review from spacedmonkey as a code owner May 2, 2024 12:03
Copy link

github-actions bot commented May 2, 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: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@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
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Thanks, @t-hamano!

@t-hamano t-hamano added the props-bot Adding this label triggers the Props Bot workflow for a PR. label May 2, 2024
@github-actions github-actions bot removed the props-bot Adding this label triggers the Props Bot workflow for a PR. label May 2, 2024
@t-hamano t-hamano merged commit 3492848 into trunk May 2, 2024
63 of 64 checks passed
@t-hamano t-hamano deleted the fix/php-warning branch May 2, 2024 12:51
@github-actions github-actions bot added this to the Gutenberg 18.3 milestone May 2, 2024
@ellatrix
Copy link
Member

ellatrix commented Jun 3, 2024

This one is not super urgent, but we'll need a backport PR for this.

@t-hamano
Copy link
Contributor Author

t-hamano commented Jun 3, 2024

This code doesn't exist in core because it's a hook for the Gutenberg plugin to override the core menu, so I don't think a backport is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants