salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.26k stars 2.03k forks source link

Module Loader fails to deploy a module if "globalSearch" user preference is not set #10450

Open JackBuchanan opened 2 weeks ago

JackBuchanan commented 2 weeks ago

Issue

When running php8+ and if the user preference "globalSearch" is not set for the current user then you get the following error when deploying :

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

Possible Fix

Add check for empty values before searching array

Steps to Reproduce the Issue

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
...

Context

No response

Version

7.14.2

What browser are you currently using?

Chrome

Browser Version

No response

Environment Information

PHP 8.2

Operating System and Version

Ubuntu 22

johnM2401 commented 2 days ago

Hey @JackBuchanan !

I've given this a try locally but I have been unable to replicate so far, I'm afraid

I've done the following:

This appears to have completed correctly with no fatal errors

I'm using: Firefox 113.0.2 / PHP 8.2.11 / MariaDB 10.4.12 / SuiteCRM version 7.14.4

Do you know if I've perhaps missed a step in replication? (or do you know if any specific Module Loader package type is needed?)

Thanks!