From 38300b7439ae1d36466f1586ff602b4cea33c8db Mon Sep 17 00:00:00 2001 From: corsacca Date: Thu, 12 Dec 2024 08:55:05 +0100 Subject: [PATCH] Don't let lower admin level locations be installed twice (#2603) --- dt-mapping/mapping-admin.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dt-mapping/mapping-admin.php b/dt-mapping/mapping-admin.php index ccc483518..9ea59b3f6 100644 --- a/dt-mapping/mapping-admin.php +++ b/dt-mapping/mapping-admin.php @@ -1178,6 +1178,10 @@ public function box_polygons_select_mirror() { } public function box_levels() { + global $wpdb; + $location_grid_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->dt_location_grid" ); + $disabled = $location_grid_count > 386000; + ?> @@ -1191,8 +1195,12 @@ public function box_levels() { (levels 3, 4, 5). Installing administrative levels will increase the database from 50k records to 380k records


+ +

All lower levels are already installed

+

Upgrade Away!

LEAVE THIS PAGE OPEN UNTIL YOU SEE "FINISHED"

+