diff --git a/phpgwapi/inc/class.egw_link.inc.php b/phpgwapi/inc/class.egw_link.inc.php index 5ce9d5f5d7..3771517f66 100644 --- a/phpgwapi/inc/class.egw_link.inc.php +++ b/phpgwapi/inc/class.egw_link.inc.php @@ -597,6 +597,11 @@ class egw_link extends solink return $title; } + /** + * Maximum number of titles to query from an application at once (to NOT trash mysql) + */ + const MAX_TITLES_QUERY = 100; + /** * Query the titles off multiple id's of one app * @@ -631,10 +636,13 @@ class egw_link extends solink } if ($ids_to_query) { - foreach(ExecMethod(self::$app_register[$app]['titles'],$ids_to_query) as $id => $t) + for ($n = 0; $ids = array_slice($ids_to_query,$n*MAX_TITLES_QUERY,100); ++$n) { - $title =& self::get_cache($app,$id); - $titles[$id] = $title = $t; + foreach(ExecMethod(self::$app_register[$app]['titles'],$ids) as $id => $t) + { + $title =& self::get_cache($app,$id); + $titles[$id] = $title = $t; + } } } return $titles;