Skip to content

Quality: fix php warning error#61321

Merged
t-hamano merged 2 commits into
trunkfrom
fix/php-warning
May 2, 2024
Merged

Quality: fix php warning error#61321
t-hamano merged 2 commits into
trunkfrom
fix/php-warning

Conversation

@t-hamano

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

Copy link
Copy Markdown
Contributor

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
@github-actions

github-actions Bot commented May 2, 2024

Copy link
Copy Markdown

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.

Comment thread lib/compat/wordpress-6.6/compat.php Outdated

@Mamaduka Mamaduka left a comment

Copy link
Copy Markdown
Member

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 Manually triggers Props Bot to ensure the list of props is up to date. label May 2, 2024
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label May 2, 2024
@t-hamano t-hamano merged commit 3492848 into trunk May 2, 2024
@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

ellatrix commented Jun 3, 2024

Copy link
Copy Markdown
Member

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

@t-hamano

t-hamano commented Jun 3, 2024

Copy link
Copy Markdown
Contributor Author

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