Closed (fixed)
Project:
Solo
Version:
1.0.34
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 Jul 2026 at 13:22 UTC
Updated:
22 Jul 2026 at 14:55 UTC
Jump to comment: Most recent
My Drupal 11.4.1 installation has the filebrowser module installed as well as the solo theme. When trying to access directories managed by filebrowser, solo crashes with this error:
Uncaught PHP Exception TypeError: "str_contains(): Argument #1 ($haystack) must be of type string, array given" at .../drupal/web/themes/solo/includes/_solo_theme_preprocess.inc line 2142
This is because the $container_id variable defined in solo_preprocess_container() is an array:
Array ( [0] => form-action-actions-wrapper )
A way to fix this problem is to extract the value contained in the array if $container_id is not a string. Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| solo_filebrowser_compat.patch | 483 bytes | lpsolit |
Comments
Comment #2
flashwebcenterHello,
Thanks again for the patch, your diagnosis was spot on, and it pointed straight to the fix.
I ended up using a slightly more defensive variation of your approach:
It does the same thing as your patch for the case you hit, and also covers a few edge cases: arrays without a numeric 0 key (associative or re-indexed), empty arrays, and non-string values. So str_contains() always receives a valid string.
While I was in there I also audited the rest of the theme for the same pattern and hardened one other spot (stripos() on $element['#name']) that could throw the identical TypeError if a module supplied an array.
This will be in the next release. Really appreciate you taking the time to report it and provide a patch.
Best wishes,
Alaa