Forum OpenACS Q&A: Fix to Script Error in admin pages

Collapse
Posted by Kevin Cheng on
You can partially fix this by modifying some code in the file /tcl/pull-down-menu-defs.tcl.  Inside proc_doc ad_pdm, search for the phrase "cascade.addMember".  It should put you in the 'if' statement that writes the javascript for each menu entry.  Replace the entire if statement (there should be 3 branches) with the code below:

# modified on 8/17/00 - Kevin Cheng

#  append statements were replaced to output the correct javascript.

    if {[empty_string_p $parent_label]} {

        append script "
    $c_parent_label.cascade.addMember("$label","$url",false);"

    } elseif {$number_of_children > 0} {

        append script "
  var $js_label = new NavBarItem("${label} ...","$url",true);"

    } else {

        append script "
  var $parent_label = new NavBarItem("$label","$url",false);"

    }

# Note that I did NOT test this on menus more than 2 levels deep, but it works with the default admin pull-down-menus. (they're pretty cool!).