Skip to content

Commit e69ff5d

Browse files
authored
Revert "225"
1 parent 14dd22a commit e69ff5d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

core/MY_Model.php

+11-3
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,14 @@ public function update($data = NULL, $column_name_where = NULL, $escape = TRUE)
612612
*/
613613
public function where($field_or_array = NULL, $operator_or_value = NULL, $value = NULL, $with_or = FALSE, $with_not = FALSE, $custom_string = FALSE)
614614
{
615+
if($this->soft_deletes===TRUE)
616+
{
617+
$backtrace = debug_backtrace(); #fix for lower PHP 5.4 version
618+
if($backtrace[1]['function']!='force_delete'){
619+
$this->_where_trashed();
620+
}
621+
}
622+
615623
if(is_array($field_or_array))
616624
{
617625
$multi = $this->is_multidimensional($field_or_array);
@@ -928,7 +936,7 @@ public function get($where = NULL)
928936
{
929937
$this->where($where);
930938
}
931-
if($this->soft_deletes===TRUE)
939+
elseif($this->soft_deletes===TRUE)
932940
{
933941
$this->_where_trashed();
934942
}
@@ -976,7 +984,7 @@ public function get_all($where = NULL)
976984
{
977985
$this->where($where);
978986
}
979-
if($this->soft_deletes===TRUE)
987+
elseif($this->soft_deletes===TRUE)
980988
{
981989
$this->_where_trashed();
982990
}
@@ -1027,7 +1035,7 @@ public function count_rows($where = NULL)
10271035
{
10281036
$this->where($where);
10291037
}
1030-
if($this->soft_deletes===TRUE)
1038+
elseif($this->soft_deletes===TRUE)
10311039
{
10321040
$this->_where_trashed();
10331041
}

0 commit comments

Comments
 (0)