EPrints Technical Mailing List Archive

Message: #00866


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] view menus with mode "sections": wrong menu level used


Hi!

On my EPrints 3.2 installation, Update::Views::create_sections_menu uses $menu = $view->{menus}->[$menu_level-1] to select the current menu.
This index is -1 in the first menu level, so the last menu entry is used in that case.

Update::Views::create_single_page_menu uses
$menu = $view->{menus}->[$menu_level], which IMHO is correct. So I believe this is a bug in create_sections_menu.

Cheers,
--leo

-------------------- 8< --------------------
--- perl_lib/EPrints/Update/Views.pm    (revision 7814)
+++ perl_lib/EPrints/Update/Views.pm    (working copy)
@@ -852,7 +871,7 @@
        my( $session, $path_values, $esc_path_values, $menus_fields, $view, $sizes, $values, $menu_fields, $has_submenu, $menu_level, $langid ) = @_;
 
        my $showvalues = get_showvalues_for_menu( $session, $view, $sizes, $values, $menu_fields );
-       my $menu = $view->{menus}->[$menu_level-1];
+       my $menu = $view->{menus}->[$menu_level];
 
        my $grouping_fn = $menu->{grouping_function};
        $grouping_fn = \&group_by_first_character if( !defined $grouping_fn );
-------------------- 8< --------------------


-- 
e-mail   ::: Leo.Bergolth (at) wu.ac.at   
fax      ::: +43-1-31336-906050
location ::: IT-Services | Vienna University of Economics | Austria