Problem/Motivation

#3574866: Skip geocoding an empty string changed an if statement, but the if-else wasn't changed to handle it.

Steps to reproduce

Geocode something with an empty string for the address. You get an error.

Proposed resolution

Modify the else-if:

        if (is_string($address) && trim($address) !== '') {
          $result = $provider->getPlugin()->geocode($address);
        }
        elseif ($address instanceof GeocodeQuery && $provider->getPlugin() instanceof ProviderGeocoderPhpInterface) {
          $result = $provider->getPlugin()->geocodeQuery($address);
        }

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork geocoder-3617742

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

solideogloria created an issue. See original summary.

solideogloria’s picture

solideogloria’s picture

Status: Active » Needs review

solideogloria’s picture

Issue tags: +Regression

  • solideogloria committed aa7adbc3 on 8.x-4.x
    Fixes #3617742: TypeError in Geocoder.php when geocoding empty string
    
itamair’s picture

Status: Needs review » Fixed

thx @solideogloria, merged into 8.x-4.x branch, will be part of next incoming Geocoder 8.x-4.35 release.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.