From edd8d3769d323ebd1ba08e6be3fa2f824b87fc08 Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 5 Mar 2015 09:13:24 -0500 Subject: [PATCH] Fix failure to save Allow Forks repository setting --- .../com/gitblit/wicket/panels/AccessPolicyPanel.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java b/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java index d8dcdced..2c880247 100644 --- a/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java @@ -26,8 +26,8 @@ import org.apache.wicket.markup.html.form.RadioGroup; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.markup.html.panel.Fragment; -import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; import com.gitblit.Constants.AccessRestrictionType; import com.gitblit.Constants.AuthorizationControl; @@ -51,8 +51,6 @@ public class AccessPolicyPanel extends BasePanel { private RadioGroup policiesGroup; - private IModel allowForks; - public AccessPolicyPanel(String wicketId, RepositoryModel repository) { this(wicketId, repository, null); } @@ -146,13 +144,12 @@ public class AccessPolicyPanel extends BasePanel { } add(policiesGroup); - allowForks = Model.of(app().settings().getBoolean(Keys.web.allowForking, true)); - if (allowForks.getObject()) { + if (app().settings().getBoolean(Keys.web.allowForking, true)) { Fragment fragment = new Fragment("allowForks", "allowForksFragment", this); fragment.add(new BooleanOption("allowForks", getString("gb.allowForks"), getString("gb.allowForksDescription"), - allowForks)); + new PropertyModel(repository, "allowForks"))); add(fragment); } else { add(new Label("allowForks").setVisible(false)); @@ -165,7 +162,6 @@ public class AccessPolicyPanel extends BasePanel { AccessPolicy policy = policiesGroup.getModelObject(); repository.authorizationControl = policy.control; repository.accessRestriction = policy.type; - repository.allowForks = allowForks.getObject(); } @Override -- 2.39.5