Index: openacs-4/packages/acs-tcl/tcl/application-data-link-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/application-data-link-procs.xql,v diff -u -N -r1.3 -r1.3.2.1 --- openacs-4/packages/acs-tcl/tcl/application-data-link-procs.xql 1 Sep 2006 20:33:18 -0000 1.3 +++ openacs-4/packages/acs-tcl/tcl/application-data-link-procs.xql 10 Jan 2007 09:45:32 -0000 1.3.2.1 @@ -40,25 +40,23 @@ - + - select o.object_id - from acs_data_links r, acs_objects o - where r.object_id_one = :from_object_id - and r.object_id_two = o.object_id - and o.object_type = :to_object_type - order by r.object_id_two + select o.object_id + from acs_objects o + where o.object_type = :to_object_type + and o.object_id in (select object_id_two from acs_data_links where object_id_one = :from_object_id) + order by o.object_id - + select i.item_id - from acs_data_links r, cr_items i - where r.object_id_one = :from_object_id - and r.object_id_two = i.item_id - and i.content_type = :to_content_type - order by r.object_id_two + from cr_items i + where i.content_type = :to_content_type + and i.item_id in (select object_id_two from acs_data_links where object_id_one = :from_object_id) + order by i.item_id