Issue Details (XML | Word | Printable)

Key: MDL-16929
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Jerome Mouneyrac
Reporter: Ralf Hilgenstock
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Bulk user export - import problem; wrong export string.

Created: 19/Oct/08 04:27 AM   Updated: 18/Mar/09 02:28 AM
Return to search
Component/s: Administration
Affects Version/s: 1.9.3
Fix Version/s: 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 2.0

File Attachments: 1. Text File MDL-16929.patch (0.7 kB)

Issue Links:
Duplicate
 

Participants: Eloy Lafuente (stronk7), Jerome Mouneyrac, Petr Skoda and Ralf Hilgenstock
Security Level: None
QA Assignee: Petr Skoda
Resolved date: 22/Oct/08
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
 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

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) added a comment - 21/Oct/08 01:39 AM
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!


Eloy Lafuente (stronk7) made changes - 21/Oct/08 01:39 AM
Field Original Value New Value
Security Minor security issue [ 10001 ]
Assignee moodle.com [ moodle.com ] Jerome Mouneyrac [ jerome ]
Jerome Mouneyrac made changes - 21/Oct/08 09:47 AM
Status Open [ 1 ] In Progress [ 3 ]
Jerome Mouneyrac added a comment - 21/Oct/08 10:21 AM
No problem, I have looked at it.

Thanks for the report and the fix.


Jerome Mouneyrac added a comment - 21/Oct/08 06:05 PM - 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')


Jerome Mouneyrac made changes - 21/Oct/08 06:05 PM
Attachment MDL-16929.patch [ 15434 ]
Jerome Mouneyrac committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 22/Oct/08 09:32 AM
MDL-16929: fix bulk user download function. (the shortname column title is now profile_field_"shortname")
MODIFY admin/user/user_bulk_download.php   Rev. 1.1.2.3    (+2 -2 lines)
Jerome Mouneyrac committed 1 file to 'Moodle CVS' - 22/Oct/08 09:33 AM
MDL-16929: fix bulk user download function. (the shortname column title is now profile_field_"shortname"), merged from 19
MODIFY admin/user/user_bulk_download.php   Rev. 1.5    (+2 -2 lines)
Jerome Mouneyrac added a comment - 22/Oct/08 09:38 AM
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


Jerome Mouneyrac made changes - 22/Oct/08 09:38 AM
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Petr Skoda added a comment - 29/Oct/08 07:44 AM
thanks, closing

Petr Skoda made changes - 29/Oct/08 07:44 AM
Status Resolved [ 5 ] Closed [ 6 ]
QA Assignee skodak
Eloy Lafuente (stronk7) made changes - 18/Mar/09 02:28 AM
Link This issue is duplicated by MDL-16721 [ MDL-16721 ]