Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
adbe17ec
Commit
adbe17ec
authored
Dec 05, 2017
by
Andrew Nicols
Committed by
jun
Dec 06, 2017
Browse files
Merge branch 'MDL-60801' of
https://github.com/andrewhancox/moodle
parents
9501b1eb
1744570b
Changes
2
Hide whitespace changes
Inline
Side-by-side
admin/tool/uploaduser/index.php
View file @
adbe17ec
...
...
@@ -358,7 +358,7 @@ if ($formdata = $mform2->is_cancelled()) {
// add default values for remaining fields
$formdefaults
=
array
();
if
(
$updatetype
!=
UU_UPDATE_FILEOVERRIDE
&&
$updatetype
!=
UU_UPDATE_NOCHANGES
)
{
if
(
!
$existinguser
||
(
$updatetype
!=
UU_UPDATE_FILEOVERRIDE
&&
$updatetype
!=
UU_UPDATE_NOCHANGES
)
)
{
foreach
(
$STD_FIELDS
as
$field
)
{
if
(
isset
(
$user
->
$field
))
{
continue
;
...
...
admin/tool/uploaduser/tests/behat/upload_users.feature
View file @
adbe17ec
...
...
@@ -38,6 +38,31 @@ Feature: Upload users
And
I set the field
"groups"
to
"Section 1 (1)"
And
the
"members"
select box should contain
"Tom Jones"
@javascript
Scenario
:
Upload users enrolling them on courses and groups applying defaults
Given the following "courses" exist
:
|
fullname
|
shortname
|
category
|
|
Maths
|
math102
|
0
|
And the following "groups" exist
:
|
name
|
course
|
idnumber
|
|
Section
1
|
math102
|
S1
|
|
Section
3
|
math102
|
S3
|
And
I log in as
"admin"
And
I navigate to
"Upload users"
node in
"Site administration > Users > Accounts"
When
I upload
"lib/tests/fixtures/upload_users.csv"
file to
"File"
filemanager
And
I press
"Upload users"
And I set the following fields to these values
:
|
City/town
|
Brighton
|
|
Department
|
Purchasing
|
And
I press
"Upload users"
And
I press
"Continue"
And
I navigate to
"Users > Accounts > Browse list of users"
in site administration
And
I should see
"Tom Jones"
And
I follow
"Tom Jones"
And
I follow
"Edit profile"
And
the field
"City/town"
matches value
"Brighton"
And
the field
"Department"
matches value
"Purchasing"
@javascript
Scenario
:
Upload users with custom profile fields
# Create user profile field.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment