Closed (fixed)
Project:
Geocoder
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2018 at 20:49 UTC
Updated:
15 Aug 2018 at 20:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
pfrenssenHere is a proposed patch, I haven't tested it yet. Will run test suite now but this takes 2 hours and by then I will be asleep :)
Comment #3
pfrenssenI've applied the patch in my project and started a test: https://app.continuousphp.com/git-hub/ec-europa/joinup-dev/build/587b10e...
Comment #4
pfrenssenOK test has turned green, it appears the exception is fixed.
Comment #5
itamair commentedThanks @pfrenssen ... I am testing and reviewing all this for actually possible use cases ... coming back asap on this.
Comment #6
itamair commentedOk ... I tested this better, with different use cases.
Probably that exception is not thrown by every Geocoder Provider.
Instead correctly intercepted before with a false AddressCollection by others.
In particular I tested with google-maps and argis-online providers.
With them an exception will be catch for IP, and the $address_collection will be returned FALSE (boolean) from the Geocode->geocode operation, and not as an empty array.
So it seems to me that the #2 patch won't prevent from the following error:
Moreover, at the actual state of 3.x dev, that error / scenario will be thrown also if the end user chooses a geocoder plugin from the back end field definition or display formatter correspondent to a (geocoder-php) Geocoder/Provider that has not been added to the Drupal project/application.
This might happen as, at the moment, the geocoder-php providers are require-dev for the 3.x dev branch:
(the above will be part of a new specific issue)
Thus I amended the previous patch with the following (to make it more robust/defensive) and added some better exceptions handlings to the Geocoder providers instances creations operations.
Going to add to dev ...
Comment #8
itamair commentedComment #9
itamair commented