- Merge request !156#3556641: Fixes Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array. → (Open) created by themodularlab
PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /var/www/html/web/modules/contrib/entity_usage/src/Routing/RouteSubscriber.php:59
Stack trace:
#0 /var/www/html/web/modules/contrib/entity_usage/src/Routing/RouteSubscriber.php(59): in_array()
#1 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteSubscriberBase.php(37): Drupal\entity_usage\Routing\RouteSubscriber->alterRoutes()
1. Use Drupal core verson: 11.2.7
2. Install entity_usage module
3. Clear cache
if (!in_array($entity_type_id, $configured_types, TRUE)) {
continue;
}
if (empty($template) || !in_array($entity_type_id, $configured_types, TRUE)) {
continue;
}
TO
if (!in_array($entity_type_id, $configured_types ?? [], TRUE)) {
continue;
}
if (empty($template) || !in_array($entity_type_id, $configured_types ?? [], TRUE)) {
continue;
}
Active
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.