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

Fix #10450 - Add check for empty value before searching array #10451

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from

Conversation

JackBuchanan
Copy link
Contributor

@JackBuchanan JackBuchanan commented Jun 16, 2024

Add empty check to avoid 500 error when deploying module from module loader

Description

Add empty check after loading user preferences to avoid 500 when running php8+

PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given

Motivation and Context

Fixes potential 500 error when deploying module from module loader if user has no global search preference set

How To Test This

  1. Reset User Preferences
  2. Avoid using functionality that will set global search user preferences e.g. global search
  3. Attempt to deploy module changes from module loader
  4. See 500 error in logs and module deploy fail to complete

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

…rray

Add empty check to avoid 500 error when deploying module from module loader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant