Moodle

Bulk user export - import problem; wrong export string.

Details

  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE

Description

user_bulk_download.php

Instaed of $v->name it should be $v-shortname

if ($extrafields = get_records_select('user_info_field')) {
foreach ($extrafields as $n=>$v){ $fields['profile_field_'.$v->shortname] = 'profile_field_'.$v->name; }
}

It should be

if ($extrafields = get_records_select('user_info_field')) {
foreach ($extrafields as $n=>$v){ $fields['profile_field_'.$v->shortname] = 'profile_field_'.$v->shortname; }
}

Error and solution found by Lars Kobbe

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Well spotted Ralf and Lars!

Assigning to Jerome and addressing for 1.9.4 (critical). Jerome can you test it now, confirm and fix if necessary?

TIA!

Show
Eloy Lafuente (stronk7) added a comment - Well spotted Ralf and Lars! Assigning to Jerome and addressing for 1.9.4 (critical). Jerome can you test it now, confirm and fix if necessary? TIA!
Hide
Jerome Mouneyrac added a comment -

No problem, I have looked at it.

Thanks for the report and the fix.

Show
Jerome Mouneyrac added a comment - No problem, I have looked at it. Thanks for the report and the fix.
Hide
Jerome Mouneyrac added a comment - - edited

I confirm the bug and the fix is good. I attached the patch. I will have a look to see if an import function into Moodle exists (probably upload user).

here are the test steps for QA retest:

1. connect as Admin in 1.9
2. Create a new profil field in Administration menu > Users > Accounts > User profile fields
2. In administration menu > Users > Accounts > Bulk User Actions > 'Add All' button
3. Select the 'Download' option in the 'With selected users' select box. > Go button
=> check that the shortname of the new profil field is displayed into the file (title of this column should be profile_field_'shortname')

Show
Jerome Mouneyrac added a comment - - edited I confirm the bug and the fix is good. I attached the patch. I will have a look to see if an import function into Moodle exists (probably upload user). here are the test steps for QA retest: 1. connect as Admin in 1.9 2. Create a new profil field in Administration menu > Users > Accounts > User profile fields 2. In administration menu > Users > Accounts > Bulk User Actions > 'Add All' button 3. Select the 'Download' option in the 'With selected users' select box. > Go button => check that the shortname of the new profil field is displayed into the file (title of this column should be profile_field_'shortname')
Hide
Jerome Mouneyrac added a comment -

I tested the Moodle upload users functionality but it apparently required a different file format anyway. If someone know what to do with the bulk user download file (I mean if you can import back into Moodle), please test it.

I commited the fix into 1.9 and HEAD.
Thanks again for the report and the fix
PS: just a note about missing test steps here: http://docs.moodle.org/en/Missing_test_steps_into_a_bug_report

Show
Jerome Mouneyrac added a comment - I tested the Moodle upload users functionality but it apparently required a different file format anyway. If someone know what to do with the bulk user download file (I mean if you can import back into Moodle), please test it. I commited the fix into 1.9 and HEAD. Thanks again for the report and the fix PS: just a note about missing test steps here: http://docs.moodle.org/en/Missing_test_steps_into_a_bug_report
Hide
Petr Škoda (skodak) added a comment -

thanks, closing

Show
Petr Škoda (skodak) added a comment - thanks, closing

Dates

  • Created:
    Updated:
    Resolved: