-
Notifications
You must be signed in to change notification settings - Fork 2
Feature: Address restriction #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Suppressing PHP 8.2 deprecation notice around callback syntax. @see https://php.watch/versions/8.2/partially-supported-callable-deprecation
The local custodian code is a numeric code used by the OS Places API. Every local authority has been assigned a code. Our address lookup element now applies the local custodian code to all Geocoder plugins it is using. Those plugins that understand this code then applies it to the address lookup process.
|
Don't know if this is helpful for your passing to gecoders, but I've got a MR https://www.drupal.org/project/geocoder/issues/3406303 so you can pass a query directly to the geocoder plugin - and hence set additional parameters on the query (often setData() is used for passing custom restrictions etc. that a geocoder supports). |
Hi Ekes, |
Not all Geocoder providers are configurable. These cannot accept the local_custodian_code parameter.
Correcting recently introduced config.
We are providing the Local custodian code through a GeocodeQuery rather than individually passing it to each geocoder plugin. This is a cleaner approach made possible by Ekes' recent change to the geocoder contrib module: https://www.drupal.org/project/geocoder/issues/3406303
…ion' into feature/borough-address-restriction
|
Ready for review. Uses the recently added "additional parameter passing to geocoders" feature of the geocoder module. Test steps
Resolves #45 |
|
Are the custodian codes going to be useful for https://github.com/localgovdrupal/localgov_os_places_geocoder_provider to be used in other geocoding? |
I think so. The latest code change in the OS Places geocoder added support for the Local custodian code. |
|
So what's the plan here @Adnan-cds ? Move some config to other localgov modules or keep it here? |
Let's see what Ekes thinks. We can move the Local custodian code configuration to localgov_geo. But then it would become site-wide rather than specific to a form element. |
|
Form builders will still need to set this in the form as sometimes we want an address for Brighton & Hove only and sometimes we want a UK wide address. |
|
Discussion in Merge Tuesday:
|
finnlewis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like there are no objections to merging this now and addressing the custodian codes move in another issue.
|
Thanks. I have just raised a ticket to explore the use of a callback to source the custodian codes. |

Additions:
Closes #45