Commit 22ba31db authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon
Browse files

Bug 1866942: set default value for groupsideblocklabels when creating a user

- when creating a user manually
- when creating a user by csv

behatnotneeded

Change-Id: I8266689b22ce17cf118043529a52dee7bb1fada9
parent 95c82b79
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ if (!($USER->get('admin') || get_config_plugin('artefact', 'file', 'institutiona
$prefs = (object) expected_account_preferences();
$elements = array_merge($elements, general_account_prefs_form_elements($prefs));
unset($prefs);

unset($elements['groupsideblocklabels']);

$form = pieform(array(
    'name'       => 'adduser',
+3 −2
Original line number Diff line number Diff line
@@ -73,7 +73,8 @@ if (count($authinstances) > 0) {
}

$prefs = (object) expected_account_preferences();

$prefs = general_account_prefs_form_elements($prefs);
unset($prefs['groupsideblocklabels']);
$form = array(
    'name' => 'uploadcsv',
    'jsform' => true,
@@ -124,7 +125,7 @@ $form = array(
            'collapsible' => true,
            'collapsed' => true,
            'class' => 'last with-formgroup',
            'elements' => general_account_prefs_form_elements($prefs),
            'elements' => $prefs,
        ),
        'progress_meter_token' => array(
            'type' => 'hidden',
+3 −1
Original line number Diff line number Diff line
@@ -94,7 +94,9 @@ echo $form_tag;

                    // Render account preferences with a renderer (inside this template :D)
                    $accountprefs = (object) expected_account_preferences();
                    $accountprefs = array_keys(general_account_prefs_form_elements($accountprefs));
                    $accountprefs = general_account_prefs_form_elements($accountprefs);
                    unset($accountprefs['groupsideblocklabels']);
                    $accountprefs = array_keys($accountprefs);
                    $fieldset_elements = array();
                    foreach ($accountprefs as $p) {
                        if (isset($elements[$p])) {