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

make sure justifyContent exists before using it #37148

Closed
wants to merge 1 commit into from

Conversation

aristath
Copy link
Member

@aristath aristath commented Dec 6, 2021

Description

I started getting PHP errors in my installation today (WP trunk, Gutenberg trunk):
PHP Notice: Undefined index: justifyContent in /var/www/src/wp-content/plugins/gutenberg/lib/block-supports/layout.php on line 170

This PR simply checks that justifyContent exists before using it, in order to avoid undefined-index errors.

How has this been tested?

After the patch I no longer get errors.

Types of changes

Added an empty() check.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@aristath aristath added the [Type] Bug An existing feature does not function as intended label Dec 6, 2021
@aristath aristath requested a review from youknowriad December 6, 2021 11:55
@youknowriad
Copy link
Contributor

youknowriad commented Dec 6, 2021

I think folks are working on removing that class entirely. cc @ntsekouras

@ntsekouras
Copy link
Contributor

Actually on Friday @mkaz had this PR for this (now merged), but this will be removed by either reverting as I proposed or by this PR if we keep these changes.

@ntsekouras ntsekouras closed this Dec 6, 2021
@youknowriad youknowriad deleted the fix/php-error/undefined-justifyContent branch December 6, 2021 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants