daveb
committed
on 26 Nov 09
Remove extra code from sql extraction. Causes error for childless items.
openacs-4/.../templates/lorsm-default.tcl (+0 -1)
41 41
42 42     set package_id [ad_conn package_id]
43 43     set package_url [apm_package_url_from_id $package_id]
44 44     set man_id [ db_string get_man_id {} ]
45 45
46 46     set folder_id [ db_string get_folder__id {} ]
47 47
48 48     # We display children
49 49     db_1row item_info {}
50 50
51 51     # Selected fields are renamed to avoid conflict with existing variables
52 52     db_multirow -extend {href} children children {} {
53 53         # Let record-view display the page
54 54         set href ${package_url}delivery/record-view
55 55         set href "[export_vars \
56 56                     -base $href \
57 57                     -url {man_id}]&item_id=$child_item_id"
58 58     }
59 59
60 60     # See if this item only has one child, if so, load that instead
61       set extracted_sql_children [template::multirow get children 1 child_item_id]
62 61     if { [template::multirow size children] == 1 && [db_string grandchildren {}] == 0 } {
63 62
64 63         set href ${package_url}delivery/record-view
65 64         set href "[export_vars \
66 65                     -base $href \
67 66                     -url {man_id}]&item_id= \
68 67                         [template::multirow get children 1 child_item_id]"
69 68         ad_returnredirect $href
70 69         ad_script_abort
71 70     }
72 71
73 72     if { [exists_and_not_null parent_item] } {
74 73
75 74         # See if the parent has a resource mapped, if none, then this is a
76 75         # top leve item, send it to the welcome page
77 76
78 77         # Also, see if item is a lone leaf node, if so, the parent was
79 78         # probably skipped and the grandparent link should be used
80 79         # instead
81 80