Fixed the filter array checking in the getStoredId method for categories as well.

This commit is contained in:
2020-12-10 17:56:47 +02:00
parent 360c61f5da
commit ef5480fc7f
49 changed files with 477 additions and 349 deletions

View File

@ -633,15 +633,16 @@ class ComponentbuilderModelFields extends JModelList
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
// Check if the value is an array
$_filter = $this->getState('filter.access');
if (ComponentbuilderHelper::checkArray($_filter))
$_access = $this->getState('filter.access');
if (ComponentbuilderHelper::checkArray($_access))
{
$id .= ':' . implode(':', $_filter);
$id .= ':' . implode(':', $_access);
}
// This should not happen, but we try
elseif (is_numeric($_filter))
// Check if this is only an int or string
elseif (is_numeric($_access)
|| ComponentbuilderHelper::checkString($_access))
{
$id .= ':' . $_filter;
$id .= ':' . $_access;
}
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
@ -651,9 +652,42 @@ class ComponentbuilderModelFields extends JModelList
$id .= ':' . $this->getState('filter.indexes');
$id .= ':' . $this->getState('filter.null_switch');
$id .= ':' . $this->getState('filter.store');
$id .= ':' . $this->getState('filter.category');
$id .= ':' . $this->getState('filter.category_id');
$id .= ':' . $this->getState('filter.catid');
// Check if the value is an array
$_category = $this->getState('filter.category');
if (ComponentbuilderHelper::checkArray($_category))
{
$id .= ':' . implode(':', $_category);
}
// Check if this is only an int or string
elseif (is_numeric($_category)
|| ComponentbuilderHelper::checkString($_category))
{
$id .= ':' . $_category;
}
// Check if the value is an array
$_category_id = $this->getState('filter.category_id');
if (ComponentbuilderHelper::checkArray($_category_id))
{
$id .= ':' . implode(':', $_category_id);
}
// Check if this is only an int or string
elseif (is_numeric($_category_id)
|| ComponentbuilderHelper::checkString($_category_id))
{
$id .= ':' . $_category_id;
}
// Check if the value is an array
$_catid = $this->getState('filter.catid');
if (ComponentbuilderHelper::checkArray($_catid))
{
$id .= ':' . implode(':', $_catid);
}
// Check if this is only an int or string
elseif (is_numeric($_catid)
|| ComponentbuilderHelper::checkString($_catid))
{
$id .= ':' . $_catid;
}
$id .= ':' . $this->getState('filter.name');
return parent::getStoreId($id);