Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
When the debug is active, leaflet_process_geofield() is trigerred a second time on views with a Markup object in the $items and it causes a fatal error.
Error: Cannot use object of type Drupal\Core\Render\Markup as array in leaflet_process_geofield() (line 141 of modules/contrib/leaflet/leaflet.module).
I will upload a patch.
Comment | File | Size | Author |
---|---|---|---|
#5 | leaflet-error-when-debug-active-2783843-5.patch | 599 bytes | jviitamaki |
#2 | leaflet-error_when_debug_active-2783843-2.patch | 952 bytes | Grimreaper |
Comments
Comment #2
GrimreaperHere is the patch.
Thanks for the review.
Comment #3
MaskOta CreditAttribution: MaskOta commentedI can confirm this problem and that this patch solves it.
Thanks
Comment #4
MaskOta CreditAttribution: MaskOta commentedI was too quick to judge.
The patch makes the error go away but then the geo point doesn't get processed.
I did something like this so the map shows properly:
Comment #5
jviitamaki CreditAttribution: jviitamaki as a volunteer and at KWD Digital commentedI couldn't replicate the problem mentioned in #4 and the first patch works properly.
When the item is of type Drupal\Core\Render\Markup only value it holds is the twig debug information therefore it's kind of useless to try to run in through geoPHP.
I refactored the patch to not include everything on one line and some added some comments for better readability.
Comment #6
jviitamaki CreditAttribution: jviitamaki as a volunteer and at KWD Digital commentedComment #7
FMB CreditAttribution: FMB commented#5 patch solved the issue, thanks.
Comment #8
Jerenus CreditAttribution: Jerenus as a volunteer commented#5 works for me.
Comment #9
friera CreditAttribution: friera as a volunteer commented#5 works for me.
Comment #10
proweb.ua CreditAttribution: proweb.ua commented#5 works
Comment #11
FMB CreditAttribution: FMB commentedThe Leaflet module no longer has a
leaflet_process_geofield()
function, I guess we should close this issue?Comment #12
itamair CreditAttribution: itamair as a volunteer commented