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:
@@ -99,6 +99,12 @@ class ItemsBaseResponse extends TemplateResponse implements ICache
|
||||
|
||||
$this->subCat = $pageParam !== '' ? '='.$pageParam : '';
|
||||
$this->filter = new ItemListFilter($this->_get['filter'] ?? '', ['parentCats' => $this->category]);
|
||||
if ($this->filter->shouldReload)
|
||||
{
|
||||
$_SESSION['error']['fi'] = $this->filter::class;
|
||||
$get = $this->filter->buildGETParam();
|
||||
$this->forward('?' . $this->pageName . $this->subCat . ($get ? '&filter=' . $get : ''));
|
||||
}
|
||||
$this->filterError = $this->filter->error;
|
||||
}
|
||||
|
||||
@@ -110,14 +116,9 @@ class ItemsBaseResponse extends TemplateResponse implements ICache
|
||||
if (!User::isInGroup(U_GROUP_EMPLOYEE))
|
||||
$conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
|
||||
|
||||
$this->filter->evalCriteria();
|
||||
$this->filter->evalWeights();
|
||||
|
||||
if ($_ = $this->filter->getConditions())
|
||||
$conditions[] = $_;
|
||||
|
||||
$this->filterError = $this->filter->error; // maybe the evalX() caused something
|
||||
|
||||
|
||||
/*******************/
|
||||
/* evaluate filter */
|
||||
|
||||
Reference in New Issue
Block a user