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
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:
- 3304799-trim-with-null
changes, plain diff MR !2
Comments
Comment #2
progzy commentedComment #5
mehul.gadaCreated MR with the fix for PHP 8.1 compatibility. Tested on local lando environment and seems to be working fine.
Comment #6
aporieDoes the job, no problem. +1 for the review.
Comment #7
super_romeo commentedWorks for me. Thank you @mehul.gada!
Comment #8
heddnActually, this is older. Closing #3348591: PHP 8.1 Update Issue as duplicate.
Comment #9
heddnThis was fixed by #3332499: Prepare Smart IP for Drupal 10.