James Moger
2015-03-05 edd8d3769d323ebd1ba08e6be3fa2f824b87fc08
Fix failure to save Allow Forks repository setting
1 files modified
10 ■■■■■ changed files
src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java
@@ -26,8 +26,8 @@
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;
@@ -50,8 +50,6 @@
    private final AjaxFormChoiceComponentUpdatingBehavior callback;
    private RadioGroup<AccessPolicy> policiesGroup;
    private IModel<Boolean> allowForks;
    public AccessPolicyPanel(String wicketId, RepositoryModel repository) {
        this(wicketId, repository, null);
@@ -146,13 +144,12 @@
        }
        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<Boolean>(repository, "allowForks")));
            add(fragment);
        } else {
            add(new Label("allowForks").setVisible(false));
@@ -165,7 +162,6 @@
        AccessPolicy policy = policiesGroup.getModelObject();
        repository.authorizationControl = policy.control;
        repository.accessRestriction = policy.type;
        repository.allowForks = allowForks.getObject();
    }
    @Override