- πΊπΈUnited States calebtr
I can confirm that this warning no longer appears in logs with version 7.x-4.6.
- Status changed to Closed: cannot reproduce
11 days ago 1:24am 11 December 2024
I'm getting this warning every time I access any page, it begun on version 7.x-3.9 but still happens on 7.x-3.10.
I don't know if this is some missing configuration on my side, but I couldn't find the problem, and Solr Searching is working fine, we had this setup for years and never had a problem with it, but this warning is annoying and causing some issues with deploy pipelines and some other stuff, so we had to downgrade the module to 7.x-3.8 to fix the issue. Here's the warning:
Warning: Invalid argument supplied for foreach() in Drupal\acquia_search\PreferredSearchCoreService->getPreferredCore() (line 85 of /docroot/sites/all/modules/contrib/acquia_connector/acquia_search/src/PreferredSearchCoreService.php).
I've compared the two versions (7.x-3.9 and 7.x-3.8), from my analysis I found out that the code part that is causing this issue is at acquia_search/acquia_search.module from line 109 to 119, specifically the line 110 which is calling isPreferredCoreAvailable() method, which calls getPreferredCore() method, which is trying to run a foreach loop on variable $this->available_cores, but it's not checking if this variable is iterable beforehand, and I think that we can do a quick and easy solution, just by checking if this variable it is iterable beforehand, this will prevent the warning, and since everything is working with this it's just the annoying warning that we want to get rid, this should work just fine.
Needs review
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I can confirm that this warning no longer appears in logs with version 7.x-4.6.