From c20c9bb59f195d05f0a9b796799fdceed0978246 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Wed, 31 Mar 2021 15:41:11 +0100 Subject: [PATCH] Make sure that VUCC_Grid hasn't been filled in before adding a gridsquare to the COL_gridsquare --- application/models/Logbook_model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index c1a8e4cf..f95f39d9 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2178,6 +2178,9 @@ class Logbook_model extends CI_Model { // check which to update - records with no Gridsquare or all records $this->db->where("COL_GRIDSQUARE is NULL or COL_GRIDSQUARE = ''"); + $where = "(COL_GRIDSQUARE is NULL or COL_GRIDSQUARE = '') AND (COL_VUCC_GRIDS is NULL or COL_VUCC_GRIDS = '')"; + $this->db->where($where); + $r = $this->db->get($this->config->item('table_name')); $count = 0;