From 0e717b49af7e311948c0ef9d281ddf9ab212935b Mon Sep 17 00:00:00 2001 From: "Alexey Y. Fedotov" Date: Fri, 8 Jan 2016 15:02:54 +0300 Subject: [PATCH] Apply filters for update --- codebase/base_connector.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/codebase/base_connector.php b/codebase/base_connector.php index 01a42ce..a8cec28 100755 --- a/codebase/base_connector.php +++ b/codebase/base_connector.php @@ -485,6 +485,7 @@ public function render(){ $this->set_relation(); if ($this->live_update !== false && $this->updating!==false) { + $this->apply_filters(); $this->live_update->get_updates(); } else { if ($this->editing){ @@ -501,10 +502,7 @@ public function render(){ $this->event->trigger("beforeSort",$wrap); $wrap->store(); - $wrap = new FilterInterface($this->request); - $this->apply_filters($wrap); - $this->event->trigger("beforeFilter",$wrap); - $wrap->store(); + $this->apply_filters(); if ($this->model && method_exists($this->model, "get")){ $this->sql = new ArrayDBDataWrapper(); @@ -887,11 +885,14 @@ public function clear_filter() { $this->request->set_filters(array()); } - protected function apply_filters($wrap) { + protected function apply_filters() { + $wrap = new FilterInterface($this->request); for ($i = 0; $i < count($this->filters); $i++) { $f = $this->filters[$i]; $wrap->add($f['name'], $f['value'], $f['operation']); } + $this->event->trigger("beforeFilter",$wrap); + $wrap->store(); } public function sort($name, $direction = false) { @@ -953,4 +954,4 @@ public function render(){ } } -?> \ No newline at end of file +?>