Closed (outdated)
Project:
Geocoder
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Jan 2020 at 23:20 UTC
Updated:
27 Jan 2020 at 00:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
itamair commentedSorry to say @arnaldop but after a quick view and first in-deep review all this seem to me both a bizzarre feature request and a very messy implementation attempt, also totally incomplete.
1 - You are asking for the implementation in the Geocoder module of a functional logics that should be addressed in the Geocode providers themselves eventually: the output/response of an Address Geocode request should be (and is) on behalf of the specific Geocoding Provider service.
The Drupal Geocoder module should/would just wrap on that and output the response, with Dumping (@GeocoderDumper plugin) the output or Re-Formatting (@GeocoderFormatter plugin) the Formatted Address output;
2 - You patch is totally incomplete (what is the geocode1 case?), doesn't comply to the Drupal coding standards at all (@sse the attached screenshot) and is also very badly written in its functional logics.
The following code snippet really doesn't makes sense to me:
(omissis)
(omissis)
(omissis)
How might the "else" statement be reached with that initial while that replicates the exact sequent "if" condition ???
I even didn't try to better understand what the whole new case "geocode": code tries to check.
Sorry to say (again) but this way of contributing sounds really un-constructive to me, and just time consuming ...
Such an incomplete patch should not be posted in this way, although tagged as "needs work" because it only makes a lot of confusion.
At least it should work somewhere.
In this case I do not see absolutely what minimum task it can perform and what specific use case it can solve, without risking to break the more general use cases functional logic ...
Comment #3
itamair commentedComment #4
arnaldop@itamair, my thoughts:
@itamair, we had a Slack chat last year and you were incredibly encouraging and inspirational. But now, I find your response to my request to be the definition of "un-constructive". You made certain assumptions, failed to try to understand the code, and then took action based on your flawed understanding.
The patch works well. Very well, actually.
It took me several hours to put it together.
Your point that perhaps this functionality should be in the providers is noted.
I feel that your response is destructive to the Drupal community as a whole, as it discourages people from trying to contribute, regardless of skill level.
In a corporate environment, your tactless response would be grounds for administrative action.
I attached an update that takes into account your comments about standards, etc., and screenshots showing this patch working as designed.
P.S.: For everyone's edification, here is the pseudocode for the case 'geocode' segment so everyone can follow:
Comment #5
itamair commentedOk. So you amended your patch, in a meaningful way ... so it looks more logic (in its functional workflow) at least to me:
- the "case 'geocode1' is not mentioned anymore ... (that couldn't be intercepted in any way);
- now the "else" statement into the "while (true)" might be thrown, and break the while itself (in the previous "allow-for-approximate-geocoding.patch" patch version it couldn't, relying on the "while" way of working);
BUT still my (personal) opinion is that your patch is trying to override a very singular specific use case of the module (when the address fails to geocode and contains a comma at the beginning, so it is supposed to might be stripped out. What about if the Address doesn't contain any comma?), and in a very specific workflow of it (it means just in the "geocoder_field_entity_presave" function and not in the more general "Drupal\geocoder\Geocoder" service ... so to behave the same in every Geocoder api implementation).
and still I think that it not his behalf ... but the single Geocoder Providers one.
It still wouldn't pass my review and I still wouldn't commit this patch into the module.
BUT ... ok. May be my point of view and feedback are too rigid and personal (although still very constructive and collaborative so as all my activities related the Drupal8 Geofield Map Stack ... so far).
So let's tag this back to "Needs Work" for a while and let's see if any other authoritative developer in Drupal 8 steps in and believes that this feature might be implemented, in your own way or in some better and more general one ... and gives a further feedback to this.
Comment #6
itamair commentedNo news oaths issue. Nobody stepped in to follow up omg this further. Closing this ...