Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
Merge branch 'pu/pm/TBPathsImproveQueryPerformanceFix' into '2020.11'
Browse files Browse the repository at this point in the history
fix(TB Path) fix perfomance improvement

See merge request tine20/tine20!1906
  • Loading branch information
paulmhh committed Mar 11, 2022
2 parents 5346ac2 + e2fd2bf commit b78a678
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tine20/Tinebase/Path/Backend/Sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,16 @@ public function search(Tinebase_Model_Filter_FilterGroup $_filter = NULL, Tineba
}

$filters = $_filter->getFilterObjects();
if (!$this->_allowComplexFilter && count($filters) > 1) {
throw new Tinebase_Exception_NotImplemented('paths don\'t support complex filters for in memory operations');
if (count($filters) > 1) {
if (!$this->_allowComplexFilter) {
throw new Tinebase_Exception_NotImplemented('paths don\'t support complex filters for in memory operations');
} else {
$filters = array_values(array_filter($_filter->getFilter('shadow_path', true, true), function ($val) {
return $val->getOperator() === 'endswith';
}));
$filters[0] = clone $filters[0];
$filters[0]->setOperator('contains');
}
}
reset($filters);
/**
Expand Down

0 comments on commit b78a678

Please sign in to comment.