Skip to content

Commit

Permalink
Merge branch '2023.11' into 2024.11
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlabci committed Feb 6, 2024
2 parents aea1653 + bd17f56 commit b4aa844
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
10 changes: 5 additions & 5 deletions tine20/Tinebase/Frontend/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -842,12 +842,12 @@ protected function _getUserRegistryData()
try {
$persistentFilters = Tinebase_Frontend_Json_PersistentFilter::getAllPersistentFilters();
} catch (Tinebase_Exception_NotFound $tenf) {
if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__
. " Failed to fetch persistent filters. Exception: \n" . $tenf);
if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) Tinebase_Core::getLogger()->warn(
__METHOD__ . '::' . __LINE__ . " Failed to fetch persistent filters. Exception:" . $tenf);
$persistentFilters = array();
} catch (Exception $e) {
if (Tinebase_Core::isLogLevel(Zend_Log::ERR)) Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__
. " Failed to fetch persistent filters. Exception: \n" . $e);
} catch (Throwable $t) {
if (Tinebase_Core::isLogLevel(Zend_Log::ERR)) Tinebase_Core::getLogger()->err(
__METHOD__ . '::' . __LINE__ . " Failed to fetch persistent filters. Error:" . $t);
$persistentFilters = array();
}

Expand Down
25 changes: 20 additions & 5 deletions tine20/Tinebase/Model/PersistentFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,26 @@ class Tinebase_Model_PersistentFilter extends Tinebase_Record_Abstract
public function setFromArray(array &$_data)
{
if (isset($_data['filters']) && ! $_data['filters'] instanceof Tinebase_Model_Filter_FilterGroup) {
try {
$_data['filters'] = $this->getFilterGroup($_data['model'], $_data['filters']);
} catch (Tinebase_Exception_NotFound $tenf) {
if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__
. ' Sort out missing ' . $_data['model'] . ' filter: ' . $tenf->getMessage());
$errorMessage = 'Sort out missing ' . $_data['model'] . ' (no model and filter found)';
if (
! class_exists($_data['model'])
&& ! class_exists(preg_replace('/Filter$/', '', $_data['model']))
) {
if (Tinebase_Core::isLogLevel(Zend_Log::ERR)) {
Tinebase_Core::getLogger()->err(
__METHOD__ . '::' . __LINE__ . ' ' . $errorMessage
);
}
} else {
try {
$_data['filters'] = $this->getFilterGroup($_data['model'], $_data['filters']);
} catch (Tinebase_Exception_NotFound $tenf) {
if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) {
Tinebase_Core::getLogger()->warn(
__METHOD__ . '::' . __LINE__ . ' ' . $errorMessage
);
}
}
}
}

Expand Down

0 comments on commit b4aa844

Please sign in to comment.