From a4488ec09049f4bb0019a2267073ab748d192f95 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 19 Jun 2016 12:58:47 +0100 Subject: [PATCH] Further regression fix with item edit and deleted flag (#672) --- application/models/Item.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/models/Item.php b/application/models/Item.php index 439ebd126..a764013aa 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -4,11 +4,14 @@ class Item extends CI_Model /* Determines if a given item_id is an item */ - public function exists($item_id, $deleted = FALSE) + public function exists($item_id, $ignore_deleted = FALSE, $deleted = FALSE) { $this->db->from('items'); $this->db->where('item_id', $item_id); - $this->db->where('deleted', $deleted); + if($ignore_deleted == FALSE) + { + $this->db->where('deleted', $deleted); + } return ($this->db->get()->num_rows() == 1); }