From 478ba80a807868f1775fdf4df665b596248fbeea Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 27 Mar 2014 09:25:36 -0400 Subject: [PATCH] Fix repository mailing list editing which prevented field reset --- releases.moxie | 1 + .../java/com/gitblit/wicket/pages/EditRepositoryPage.java | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/releases.moxie b/releases.moxie index c9687e26..0a57d400 100644 --- a/releases.moxie +++ b/releases.moxie @@ -10,6 +10,7 @@ r22: { text: ~ security: ~ fixes: + - Repository mailing lists could not be reset from the Edit Repository page (issue-399) - Ensure the Lucene ticket index is updated on repository deletion. changes: - Option to allow LDAP users to directly authenticate without performing LDAP searches diff --git a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java index f860eeb3..1f37763a 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java +++ b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java @@ -339,7 +339,9 @@ public class EditRepositoryPage extends RootSubPage { // set author metric exclusions String ax = metricAuthorExclusions.getObject(); - if (!StringUtils.isEmpty(ax)) { + if (StringUtils.isEmpty(ax)) { + repositoryModel.metricAuthorExclusions = new ArrayList(); + } else { Set list = new HashSet(); for (String exclusion : StringUtils.getStringsFromValue(ax, " ")) { if (StringUtils.isEmpty(exclusion)) { @@ -356,7 +358,9 @@ public class EditRepositoryPage extends RootSubPage { // set mailing lists String ml = mailingLists.getObject(); - if (!StringUtils.isEmpty(ml)) { + if (StringUtils.isEmpty(ml)) { + repositoryModel.mailingLists = new ArrayList(); + } else { Set list = new HashSet(); for (String address : ml.split("(,|\\s)")) { if (StringUtils.isEmpty(address)) { -- 2.39.5