java-topology/defects/suitecrm/patch/suitecrm-0002-jjwg_maps-records-in_array.patch

23 lines
1.3 KiB
Diff

# UNDF: UNDF-2026-000000872
--- a/modules/jjwg_Maps/controller.php
+++ b/modules/jjwg_Maps/controller.php
@@ -938,6 +938,7 @@
}
}
//var_dump($records);
+ $recordsSet = !empty($records) ? array_flip($records) : array(); // O(1) lookup
// Find the Items to Display
// Assume there is no address at 0,0; it's in the Atlantic Ocean!
@@ -959,10 +960,10 @@
while ($display = $this->bean->db->fetchByAssoc($display_result)) {
if (!empty($search_array['where'])) { // Select all records (advanced search) with where clause
- if (in_array($display['id'], $records)) {
+ if (isset($recordsSet[$display['id']])) {
$this->bean->map_markers[] = $this->getMarkerData($display_module, $display, false, $mod_strings_display);
}
} elseif (!empty($_REQUEST['uid'])) { // Several records selected or this page selected
- if (in_array($display['id'], $records)) {
+ if (isset($recordsSet[$display['id']])) {
$this->bean->map_markers[] = $this->getMarkerData($display_module, $display, false, $mod_strings_display);
}