[-] BO : fix #PSTEST-1169 broken processing of list filters
This commit is contained in:
1 parent
2647de3670
commit
e3d544e2e1
1 file changed
+8
-4
@@ -1697,24 +1697,28 @@ class AdminControllerCore extends Controller
|
|||||||
// Filter memorization
|
// Filter memorization
|
||||||
if (isset($_POST) && !empty($_POST) && isset($this->table))
|
if (isset($_POST) && !empty($_POST) && isset($this->table))
|
||||||
foreach ($_POST as $key => $value)
|
foreach ($_POST as $key => $value)
|
||||||
|
{
|
||||||
if (is_array($this->table))
|
if (is_array($this->table))
|
||||||
{
|
{
|
||||||
foreach ($this->table as $table)
|
foreach ($this->table as $table)
|
||||||
if (strncmp($key, $table.'Filter_', 7) === 0 || strncmp($key, 'submitFilter', 12) === 0)
|
if (stripos($key, $table.'Filter_') === 0 || stripos($key, 'submitFilter') === 0)
|
||||||
$this->context->cookie->$key = !is_array($value) ? $value : serialize($value);
|
$this->context->cookie->$key = !is_array($value) ? $value : serialize($value);
|
||||||
}
|
}
|
||||||
elseif (strncmp($key, $this->table.'Filter_', 7) === 0 || strncmp($key, 'submitFilter', 12) === 0)
|
elseif (stripos($key, $this->table.'Filter_') === 0 || stripos($key, 'submitFilter') === 0)
|
||||||
$this->context->cookie->$key = !is_array($value) ? $value : serialize($value);
|
$this->context->cookie->$key = !is_array($value) ? $value : serialize($value);
|
||||||
|
}
|
||||||
if (isset($_GET) && !empty($_GET) && isset($this->table))
|
if (isset($_GET) && !empty($_GET) && isset($this->table))
|
||||||
foreach ($_GET as $key => $value)
|
foreach ($_GET as $key => $value)
|
||||||
|
{
|
||||||
if (is_array($this->table))
|
if (is_array($this->table))
|
||||||
{
|
{
|
||||||
foreach ($this->table as $table)
|
foreach ($this->table as $table)
|
||||||
if (strncmp($key, $table.'OrderBy', 7) === 0 || strncmp($key, $table.'Orderway', 8) === 0)
|
if (stripos($key, $table.'OrderBy') === 0 || stripos($key, $table.'Orderway') === 0)
|
||||||
$this->context->cookie->$key = $value;
|
$this->context->cookie->$key = $value;
|
||||||
}
|
}
|
||||||
elseif (strncmp($key, $this->table.'OrderBy', 7) === 0 || strncmp($key, $this->table.'Orderway', 12) === 0)
|
elseif (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0)
|
||||||
$this->context->cookie->$key = $value;
|
$this->context->cookie->$key = $value;
|
||||||
|
}
|
||||||
|
|
||||||
// Manage list filtering
|
// Manage list filtering
|
||||||
if (Tools::isSubmit('submitFilter'.$this->table) || $this->context->cookie->{'submitFilter'.$this->table} !== false)
|
if (Tools::isSubmit('submitFilter'.$this->table) || $this->context->cookie->{'submitFilter'.$this->table} !== false)
|
||||||
|
|||||||
Reference in new issue
Block a user