Problem/Motivation

At some point, in "smart_ip/src/SmartIp.php" file since

public static function query($ip = NULL)

accepts null value it could lead to

trim(): Passing null to parameter #1 ($string) of type string is deprecated in /web/modules/contrib/smart_ip/src/SmartIp.php line 30

and fatal error on execution

Steps to reproduce

Query with a null value / behat test

Proposed resolution

Check if value is null.

Remaining tasks

Fix

User interface changes

n/a

API changes

n/a (?)

Data model changes

n/a

Issue fork smart_ip-3304799

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

progzy created an issue. See original summary.

progzy’s picture

Issue summary: View changes

mehul.gada made their first commit to this issue’s fork.

mehul.gada’s picture

Status: Active » Needs review

Created MR with the fix for PHP 8.1 compatibility. Tested on local lando environment and seems to be working fine.

aporie’s picture

Does the job, no problem. +1 for the review.

super_romeo’s picture

Works for me. Thank you @mehul.gada!

heddn’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#3348591: PHP 8.1 Update Issue

Actually, this is older. Closing #3348591: PHP 8.1 Update Issue as duplicate.

heddn’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Related issues: +#3332499: Prepare Smart IP for Drupal 10