- First commit to issue fork.
- 🇧🇪Belgium svendecabooter Gent
Created a new MR for the 4.x branch + adding patch file.
- Status changed to Needs work
7 months ago 10:19am 24 August 2024 - 🇮🇹Italy itamair
Thanks here ... this looks a nice feature / add on and a technically correct implementation, that indeed will dispatch a specific Geocoder Event every time a Geocoding operation is going to fail, but why do you call it GeocoderLogEvent instead of something more properly related to the specific context you want to intercept / catch, and that is strictly dependant from a caught exception message?
Rather I would define a GeocoderFailExcpetionEvent and trigger it only in the same Geocoder catches exceptions that you pointed.
GeocoderLogEvent sound more something that might / should be dispatched every time a 'geocoder' log is generated in the system, isn't it?
- 🇮🇹Italy itamair
ok ... I better inspected all this and I must say that it doesn't match my agreement.
First of all the Title of this issue ("Dispatch events for certain situations") trigger a wider use context compared to the specific use case the provided MR / Patch tries to implement ... (that only focus on the Geocoding failing cases).
Furthermore there is a not so strong and opportune use of the drupal_static function (in my opinion), because of the following:
- drupal_static() and drupal_static_reset() are going to be soon deprecated ( https://www.drupal.org/node/2260187 → );
- from my test (on the MR !58) passing the whole ContentEntityInterface $entity in drupal_static doesn't work, as the &drupal_static(self::STATIC_ENTITY_KEY) will always return NULL (rather / eventually a string, such as the $entity->label() should be used ... );It looks (to me) a much better and more general approach should be implemented, to comply to this title ambitions / goal ...
- First commit to issue fork.
- 🇧🇪Belgium dtrdewaele
Hi,
Thank you for your feedback! I fixed the MR for now, so we can use it for our clients needs, but we have put this ticket on the community wishlist of the company. If our team agrees on this, we will work out a better implementation for this.