From 7f14da3aceae2db516a7bec2c2e00d48049ec7b5 Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 28 Dec 2011 16:58:42 -0500 Subject: [PATCH] Strip named repository parameter from root page parameters --- src/com/gitblit/wicket/pages/RootPage.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/com/gitblit/wicket/pages/RootPage.java b/src/com/gitblit/wicket/pages/RootPage.java index 4021e5c0..f8fd8a8c 100644 --- a/src/com/gitblit/wicket/pages/RootPage.java +++ b/src/com/gitblit/wicket/pages/RootPage.java @@ -94,8 +94,8 @@ public abstract class RootPage extends BasePage { // navigation links List pages = new ArrayList(); - pages.add(new PageRegistration("gb.repositories", RepositoriesPage.class, getPageParameters())); - pages.add(new PageRegistration("gb.activity", ActivityPage.class, getPageParameters())); + pages.add(new PageRegistration("gb.repositories", RepositoriesPage.class, getRootPageParameters())); + pages.add(new PageRegistration("gb.activity", ActivityPage.class, getRootPageParameters())); if (showAdmin) { pages.add(new PageRegistration("gb.users", UsersPage.class)); } @@ -163,6 +163,15 @@ public abstract class RootPage extends BasePage { super.setupPage(repositoryName, pageName); } + + private PageParameters getRootPageParameters() { + PageParameters params = getPageParameters(); + if (params != null) { + // remove named repository parameter + params.remove("r"); + } + return params; + } private void loginUser(UserModel user) { if (user != null) { -- 2.39.5