- Issue created by @bigbaldy
- 🇮🇹Italy itamair
thanks @bigbaldy for reporting this,BUT I cannot reproduce what you report.
This Leaflet 10.2.45 based demo site / view:
https://www.geodemocracy.com/drupal_geofield_stack_demo/web/geo-place/da...
is working correctly with tooltips (as you can clearly see), with not logging that error that you report.You mention the Leaflet Formatter, but then your error reports the LeafletMap View style class,
and that is also a bit misleading ...
But also the Leaflet Formatters are working correctly, as you can see from these 2 example pages:
https://www.geodemocracy.com/drupal_geofield_stack_demo/web/geo-place/da...
https://www.geodemocracy.com/drupal_geofield_stack_demo/web/it/geo-place...Anyway, may be your use case is having some specific Leaflet Tooltip token / replacement setup,
and some more solid and defensive code in parsing/casting that Render/Markup into a string is worth the case.Could you please QA and Test the attached patch with the latest Leaflet 10.2.45 and confirm if that solves this issue of you, or still not?
And let us know here ... - 🇺🇸United States bigbaldy
@itamair I'm continuing to investigate the issue and will try the patch. Thanks for the quick response.
- 🇨🇦Canada mandclu
I encountered this same bug, using Leaflet on a fresh install of Drupal 11. Here are steps to reproduce the problem on a newly installed site:
- Require and apply the Locations recipe →
- Go to add a location node
- On save, you will encounter the error
Here is the full error output:
TypeError thrown with message "Drupal\Component\Utility\Html::decodeEntities(): Argument #1 ($text) must be of type string, Drupal\Core\Render\Markup given, called in /var/www/html/web/modules/contrib/leaflet/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php on line 1461" Stacktrace: #39 TypeError in /var/www/html/web/core/lib/Drupal/Component/Utility/Html.php:393 #38 Drupal\Component\Utility\Html:decodeEntities in /var/www/html/web/modules/contrib/leaflet/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php:1461 #37 Drupal\leaflet_views\Plugin\views\style\LeafletMap:processFeatureTooltips in /var/www/html/web/modules/contrib/leaflet/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php:1368 #36 Drupal\leaflet_views\Plugin\views\style\LeafletMap:processFeature in /var/www/html/web/modules/contrib/leaflet/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php:1116 #35 Drupal\leaflet_views\Plugin\views\style\LeafletMap:processEntityFeatures in /var/www/html/web/modules/contrib/leaflet/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php:999 #34 Drupal\leaflet_views\Plugin\views\style\LeafletMap:processGeofield in /var/www/html/web/modules/contrib/leaflet/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php:940 #33 Drupal\leaflet_views\Plugin\views\style\LeafletMap:processResultsGroups in /var/www/html/web/modules/contrib/leaflet/modules/leaflet_views/src/Plugin/views/style/LeafletMap.php:897 #32 Drupal\leaflet_views\Plugin\views\style\LeafletMap:render in /var/www/html/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php:2203 #31 Drupal\views\Plugin\views\display\DisplayPluginBase:render in /var/www/html/web/core/modules/views/src/ViewExecutable.php:1593 #30 Drupal\views\ViewExecutable:render in /var/www/html/web/core/modules/views/src/Plugin/views/display/Page.php:201 #29 Drupal\views\Plugin\views\display\Page:execute in /var/www/html/web/core/modules/views/src/ViewExecutable.php:1690 #28 Drupal\views\ViewExecutable:executeDisplay in /var/www/html/web/core/modules/views/src/Element/View.php:81 #27 Drupal\views\Element\View:preRenderViewElement in /var/www/html/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php:107 #26 call_user_func_array in /var/www/html/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php:107 #25 Drupal\Core\Render\Renderer:doTrustedCallback in /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php:830 #24 Drupal\Core\Render\Renderer:doCallback in /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php:387 #23 Drupal\Core\Render\Renderer:doRender in /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php:203 #22 Drupal\Core\Render\Renderer:render in /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php:238 #21 Drupal\Core\Render\MainContent\HtmlRenderer:Drupal\Core\Render\MainContent\{closure} in /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php:593 #20 Drupal\Core\Render\Renderer:executeInRenderContext in /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php:231 #19 Drupal\Core\Render\MainContent\HtmlRenderer:prepare in /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php:128 #18 Drupal\Core\Render\MainContent\HtmlRenderer:renderResponse in /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php:90 #17 Drupal\Core\EventSubscriber\MainContentViewSubscriber:onViewRenderArray in /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:246 #16 Symfony\Component\EventDispatcher\EventDispatcher:Symfony\Component\EventDispatcher\{closure} in /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:206 #15 Symfony\Component\EventDispatcher\EventDispatcher:callListeners in /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php:56 #14 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in /var/www/html/vendor/symfony/http-kernel/HttpKernel.php:188 #13 Symfony\Component\HttpKernel\HttpKernel:handleRaw in /var/www/html/vendor/symfony/http-kernel/HttpKernel.php:76 #12 Symfony\Component\HttpKernel\HttpKernel:handle in /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php:53 #11 Drupal\Core\StackMiddleware\Session:handle in /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:48 #10 Drupal\Core\StackMiddleware\KernelPreHandle:handle in /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php:28 #9 Drupal\Core\StackMiddleware\ContentLength:handle in /var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php:32 #8 Drupal\big_pipe\StackMiddleware\ContentLength:handle in /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:116 #7 Drupal\page_cache\StackMiddleware\PageCache:pass in /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:90 #6 Drupal\page_cache\StackMiddleware\PageCache:handle in /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:48 #5 Drupal\Core\StackMiddleware\ReverseProxyMiddleware:handle in /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php:51 #4 Drupal\Core\StackMiddleware\NegotiationMiddleware:handle in /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php:36 #3 Drupal\Core\StackMiddleware\AjaxPageState:handle in /var/www/html/web/modules/contrib/whoops/src/StackMiddleware/WhoopsMiddleware.php:49 #2 Drupal\whoops\StackMiddleware\WhoopsMiddleware:handle in /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php:51 #1 Drupal\Core\StackMiddleware\StackedHttpKernel:handle in /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php:709 #0 Drupal\Core\DrupalKernel:handle in /var/www/html/web/index.php:19
I also found that reverting back to the previous release resolved the issue, but the patch gets things working as expected too.
- 🇮🇹Italy itamair
New Leaflet 10.2.46 release → just deployed with #2 patch.
Closing this as FIXED ... please reopen if this issue still happening.