mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Filter/Errors
* move checks to __construct so they can be run on $_POST data and don't create malformed filter urls * if we received malformed $_GET params, build new params and reload * do not store error state in cache * cleanup
This commit is contained in:
@@ -336,7 +336,7 @@ class PageTemplate
|
||||
$result[] = "var fi_type = '".$this->filter->fiType."'";
|
||||
|
||||
if ($this->filter->fiSetCriteria) // arr:criteria, arr:signs, arr:values
|
||||
$result[] = 'fi_setCriteria('.mb_substr(Util::toJSON(array_values($this->filter->fiSetCriteria)), 1, -1).");";
|
||||
$result[] = 'fi_setCriteria('.mb_substr(Util::toJSON($this->filter->fiSetCriteria), 1, -1).");";
|
||||
|
||||
/*
|
||||
nt: don't try to match provided weights on predefined weight sets (preselects preset from opt list and ..?)
|
||||
@@ -496,7 +496,7 @@ class PageTemplate
|
||||
|
||||
foreach ($this->lvTabs->iterate() as $lv)
|
||||
if ($lv instanceof \Aowow\Listview)
|
||||
$lv->setError();
|
||||
$lv->setError(true);
|
||||
}
|
||||
|
||||
// pre-serialization: if a var is relevant it was stored in $rawData
|
||||
@@ -505,6 +505,11 @@ class PageTemplate
|
||||
$this->context = null; // unlink from TemplateResponse
|
||||
$this->pageData = []; // clear modified data
|
||||
|
||||
if ($this->lvTabs) // do not store lvErrors in cache
|
||||
foreach ($this->lvTabs->iterate() as $lv)
|
||||
if ($lv instanceof \Aowow\Listview)
|
||||
$lv->setError(false);
|
||||
|
||||
$vars = [];
|
||||
foreach ($this as $k => $_)
|
||||
$vars[] = $k;
|
||||
|
||||
Reference in New Issue
Block a user