Thanks Ralf for your advice, I had a look to class.link_widget.inc.php and noticed that on line 277 the method egw_link::get_links (inside case ‘link-list’) had no only_app parameter defined.
I managed to use this parameter by catching the variable $value[‘only_app’] defined in my class.addressbook_ui.inc.php, but as soon as I use it, I get this error :
Fatal error: Cannot create references to/from string offsets nor overloaded objects in
..../egroupware/etemplate/inc/class.boetemplate.inc.php on line 618
If I set my only_app parameter to anything but an application name, eg: test, it’s working, and result an empty list as test application doesn’t exist…
Here is a diff to show you what I have now :
@@ -264,6 +264,7 @@
case 'link-list':
$app = $value['to_app'];
$id = isset($extension_data['to_id']) ? $extension_data['to_id'] : $value['to_id'];
+ $onlyapp = $value['only_app'];
if ($this->debug)
{
echo "<p>link-list-widget[$name].preprocess: value="; _debug_array($value);
@@ -272,7 +273,7 @@
{
$value['title'] = egw_link::title($app,$id);
}
- $links = egw_link::get_links($app,$id,'','link_lastmod DESC',true);
+ $links = egw_link::get_links($app,$id,$onlyapp,'link_lastmod DESC',true);
$value['anz_links'] = count($links);
$extension_data = $value;
This should work, as the parameter was not used before.
I have set DEBUG constant to true in class.egw_link.inc.php, to be able to watch methods and parameters, and I can see that my only_app is used.
I can show you to be more explicit, the differences in both cases :
1 - When I use ‘test’ as only_app :
egw_link::title('addressbook','65003')='contact name' (from cache)
egw_link::get_links(app='addressbook',id='65003',only_app='test',order='link_lastmod DESC')
egw_link::title('addressbook','65003')='contact name linked' (from cache)
egw_link::get_links(app='addressbook',id='65003',only_app='test',order='link_lastmod DESC')
Then everything is showing without a problem.
2 - When I use ‘addressbook’ as only_app : (or any other existing applications)
egw_link::title('addressbook','65003')='contact name' (from cache)
egw_link::get_links(app='addressbook',id='65003',only_app='addressbook',order='link_lastmod DESC')
egw_link::titles(9,9)
egw_link::title('9','9')='Array' (from cache)
Fatal error: Cannot create references to/from string offsets nor overloaded objects in
..../egroupware/etemplate/inc/class.boetemplate.inc.php on line 618
If any idea of what is going on, I am interested. Otherwise I am carrying on my research…
Thanks
jies