Problem/Motivation
I am getting the following deprecation warning on PHP 8.1:
Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\geofield\Plugin\views\argument\GeofieldProximityArgument->getParsedReferenceLocation() (line 209 of modules/contrib/geofield/src/Plugin/views/argument/GeofieldProximityArgument.php).
We are using the return value of \Drupal\views\Plugin\views\argument\ArgumentPluginBase::getValue() and passing it to trim() without checking if it is a NULL value. Passing null values to trim() is deprecated in PHP 8.1.
Proposed resolution
Check if the value is NULL, or directly cast it to a string before trimming.
Issue fork geofield-3378136
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
Comment #2
pfrenssenComment #4
pfrenssenComment #5
didebruReviewed +RTBC from my point of view.
Comment #8
itamair commentedThanks @pfrenssen, nice catch ... committed into dev, already part of new release 8.x-1.54
Comment #9
pfrenssenWow thanks for the quick reaction!