From: James Moger Date: Thu, 5 Mar 2015 14:13:24 +0000 (-0500) Subject: Fix failure to save Allow Forks repository setting X-Git-Tag: v1.7.0~1^2~83^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Ftickets%2F43%2F243%2F1;p=gitblit.git Fix failure to save Allow Forks repository setting --- 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