Passing null to parameter #1 ($haystack) of type string is deprecated

Created on 27 February 2023, over 1 year ago
Updated 30 April 2024, 7 months ago

Problem/Motivation

PHPUnit test failed due to deprecation notice

Unsilenced deprecation notices (9)

  6x: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated
    6x in GatsbyEntityLoggerTest::testEntityInsert from Drupal\Tests\gatsby\Kernel

  3x: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated
    3x in GatsbyEntityLoggerTest::testEntityInsert from Drupal\Tests\gatsby\Kernel

in core files.

  1. web\core\lib\Drupal\Core\EventSubscriber\RssResponseRelativeUrlFilter.php
  2. web\core\modules\jsonapi\src\EventSubscriber\ResourceResponseValidator.php
  3. web\core\lib\Drupal\Core\EventSubscriber\ActiveLinkResponseFilter.php

Steps to reproduce

PHPUnit test of gatsby module's logger file. gatsby/tests/src/Kernel/GatsbyEntityLoggerTest.php
Error raised here 📌 Drupal 10 compatibility issues Fixed

Proposed resolution

Check headers value first.

Remaining tasks

Create patch as per proposed resolution.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
JSON API 

Last updated 7 days ago

Created by

🇮🇳India Jaykumar95 Ahmedabad

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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