TypeError: Argument #1 ($array) must be of type array, bool given in array_keys()

Created on 17 January 2023, about 2 years ago
Updated 24 January 2023, almost 2 years ago

Problem/Motivation

If subscription settings are not set (local variables and acquia cloud), 500 error and warnings in 'admin/config/search/apachesolr' will appear.

TypeError: array_keys(): Argument #1 ($array) must be of type array, bool given in array_keys() (line 264 of ../acquia_connector/acquia_search/src/PreferredSearchCoreService.php)

Warning: Trying to access array offset on value of type null in AcquiaSearchV3ApacheSolr->setUrl() (line 102 of ../acquia_connector/acquia_search/src/v3/AcquiaSearchV3ApacheSolr.php).

Warning: foreach() argument must be of type array|object, bool given in Drupal\acquia_search\PreferredSearchCoreService->getPreferredCore() (line 132 of ../acquia_connector/acquia_search/src/PreferredSearchCoreService.php).

This case is reproduced, when we install the deployed to Acquia cloud site locally and data from Acquia are missing.
This case is successfully handled in the previous version of the module (before 7.x-4.0), when we get a message:

Message: Sign up for Acquia Cloud Free, a free Drupal sandbox to experiment with new features, test your code quality, and apply continuous integration best practices. Check out the epic set of dev features and toolsthat come with your free subscription.If you have an Acquia Subscription, connect now. Otherwise, you can turn this message off by disabling the Acquia Subscription modules.'
πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡§πŸ‡ΎBelarus alena_stanul

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024