Deprecated function: stripos(): Passing null to parameter #1

Created on 10 January 2024, 11 months ago
Updated 11 January 2024, 11 months ago

On select Group (autocomplete) of context in watchdog

Deprecated function: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\context_ui\Controller\ContextUIController->groupsAutocomplete() (line 94 of /var/www/example.com/modules/context/modules/context_ui/src/Controller/ContextUIController.php)

Drupal Version: 10.2.1 PHP:8.2
https://stackoverflow.com/a/75123415/6687047
\context\modules\context_ui\src\Controller\ContextUIController.php

    foreach ($this->contextManager->getContexts() as $context) {
      //if (stripos($context->getGroup(), $query) === 0) {
      if (stripos($context->getGroup() ?? '', $query) === 0) {
        $matches[] = $context->getGroup();
      }
    }

๐Ÿ› Bug report
Status

Needs review

Version

5.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024