SQL error when adding users by CSV

Bug #1399464 reported by Son Nguyen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Critical
Son Nguyen

Bug Description

Version: master(15.04)

Adding users by CSV causes errors:

 [WAR] cf (lib/errors.php:745) Invalid values parameter sent to get_recordset_sql.
Call stack (most recent first):
log_message("Invalid values parameter sent to get_recordset_sql...", 8, true, true) at /home/sonn/code/mahara/master/htdocs/lib/errors.php:95
log_warn("Invalid values parameter sent to get_recordset_sql...") at /home/sonn/code/mahara/master/htdocs/lib/errors.php:745
SQLException->__construct("Invalid values parameter sent to get_recordset_sql...") at /home/sonn/code/mahara/master/htdocs/lib/dml.php:457
get_recordset_sql("SELECT * FROM "mh15_usr" WHERE LOWER(username) = ?", "u01", 0, 1) at /home/sonn/code/mahara/master/htdocs/lib/dml.php:211
record_exists_sql("SELECT * FROM "mh15_usr" WHERE LOWER(username) = ?", "u01") at /home/sonn/code/mahara/master/htdocs/lib/dml.php:197
record_exists_select("usr", "LOWER(username) = ?", "u01") at /home/sonn/code/mahara/master/htdocs/admin/users/uploadcsv.php:312
uploadcsv_validate(object(Pieform), array(size 19)) at Unknown:0
call_user_func_array("uploadcsv_validate", array(size 2)) at /home/sonn/code/mahara/master/htdocs/lib/pieforms/pieform.php:1382
Pieform->validate(array(size 19)) at /home/sonn/code/mahara/master/htdocs/lib/pieforms/pieform.php:505
Pieform->__construct(array(size 4)) at /home/sonn/code/mahara/master/htdocs/lib/pieforms/pieform.php:162
Pieform::process(array(size 4)) at /home/sonn/code/mahara/master/htdocs/lib/pieforms/pieform.php:71
pieform(array(size 4)) at /home/sonn/code/mahara/master/htdocs/admin/users/uploadcsv.php:589

Tags: regression
Revision history for this message
Son Nguyen (ngson2000) wrote :

The $values parameter passed to the function record_exists_select() must be an array

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/4063

tags: added: regression
Revision history for this message
Eduardo (o-eduardo) wrote :

Full testing method:

1. Log in as Admin
2. Go to Administration
3. Go to Users
4. Go to “Add users by CSV”
5. Click “Browse...”
6. Add a CSV file
7. Click “Add users by CSV”
8. You should see “Your CSV file was processed successfully”
9. You should see “New users added: X”

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/4063
Committed: http://gitorious.org/mahara/mahara/commit/2649e66000eec9d8e4a0ec9553f0c810b7bcb4cd
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 2649e66000eec9d8e4a0ec9553f0c810b7bcb4cd
Author: Son Nguyen <email address hidden>
Date: Fri Dec 5 11:37:40 2014 +1300

Fix incorrect calls to record_exists_select()

Bug 1399464: $values param must be an array

Change-Id: Ia865e42641830400fffeb3950f6cbe4fbed7ccbb
Signed-off-by: Son Nguyen <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/4062
Committed: http://gitorious.org/mahara/mahara/commit/6005cc62be54abea9e8fd5ee39cc195447099c10
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 6005cc62be54abea9e8fd5ee39cc195447099c10
Author: Son Nguyen <email address hidden>
Date: Fri Dec 5 11:18:14 2014 +1300

Fix error in "user" generator. Bug 1399464

Change-Id: I1b8f1d002dd4679b25c7ae4fdcdb6af2ee73e933

Aaron Wells (u-aaronw)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.