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
@jack7anderson7 jack7anderson7 added Status: Requires Testing Requires Manual Testing Status: Passed Code Review Mark issue has passed code review reviewed labels Aug 22, 2024
Copy link
Contributor

@johnM2401 johnM2401 left a comment

Choose a reason for hiding this comment

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

LGTM
Not able to replicate the initial issue, but fix is non-destructive.
Module Loader and Module Builder->Deploy seem unaffected

@johnM2401 johnM2401 added Status: Passed Testing and removed Status: Requires Testing Requires Manual Testing labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Passed Code Review Mark issue has passed code review reviewed Status: Passed Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants