[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] maps: Sometimes (according to permissions) links are not rendered and...

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6995e6b3480fc_3ba4ead411833@gitlab-sidekiq-low-urgency-cpu-bound-v2-68c86796b8-z9sqh.mail>

Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
a6a6cfc4 by Jonny Bradley at 2026-02-18T16:08:45+00:00
[FIX] maps: Sometimes (according to permissions) links are not rendered and...
---
* [FIX] maps: Sometimes (according to permissions) links are not rendered and can cause a jQuery exception, breaking feature loading, so absorb any errors and try to carry on.
Manual backport for 27.x as OpenLayers2 has been removed in 29.x+

See merge request tikiwiki/tiki!9598

- - - - -


2 changed files:

- lib/jquery_tiki/tiki-maps-ol3.js
- lib/jquery_tiki/tiki-maps.js


Changes:

=====================================
lib/jquery_tiki/tiki-maps-ol3.js
=====================================
@@ -1334,12 +1334,16 @@
                                     form.autoLayers.push(layerName);
                                 }
 
-                                var icon;
-                                $(i.link).each(function () {    // if the object has an img with it (tracker status for instance) then we need to find the <a>
-                                    if ($(this).is("a")) {    // and just using $(i.link).find("a") doesn't work for some reason
-                                        icon = $(this).data('icon-src');
-                                    }
-                                });
+                                let icon = "";
+                                try {
+                                    $(i.link).each(function () {
+                                        // if the object has an img with it (tracker status for instance) then we need to find the <a>
+                                        if ($(this).is("a")) {
+                                            // and just using $(i.link).find("a") doesn't work for some reason
+                                            icon = $(this).data("icon-src");
+                                        }
+                                    });
+                                } catch (e) {}
 
                                 if (i.geo_location) {
                                     $(container).addMapMarker({


=====================================
lib/jquery_tiki/tiki-maps.js
=====================================
@@ -1075,12 +1075,16 @@
                                     form.autoLayers.push(layerName);
                                 }
 
-                                var icon;
-                                $(i.link).each(function () {    // if the object has an img with it (tracker status for instance) then we need to find the <a>
-                                    if ($(this).is("a")) {    // and just using $(i.link).find("a") doesn't work for some reason
-                                        icon = $(this).data('icon-src');
-                                    }
-                                });
+                                let icon = "";
+                                try {
+                                    $(i.link).each(function () {
+                                        // if the object has an img with it (tracker status for instance) then we need to find the <a>
+                                        if ($(this).is("a")) {
+                                            // and just using $(i.link).find("a") doesn't work for some reason
+                                            icon = $(this).data("icon-src");
+                                        }
+                                    });
+                                } catch (e) {}
 
                                 if (i.geo_location) {
                                     $(container).addMapMarker({



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/a6a6cfc4fbbe5927c3d0676a7697ba7829ce0854

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/a6a6cfc4fbbe5927c3d0676a7697ba7829ce0854
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.