Error message when searching for users in web services logs

Bug #1486766 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon
15.10
Fix Released
Undecided
Unassigned

Bug Description

master 15.10dev

When you search for a user on /webservice/admin/webservicelogs.php and click the "Go" button, you get the following error messages:

[WAR] d7 (lib/dml.php:1578) Array to string conversion
Call stack (most recent first):

    log_message("Array to string conversion", 8, true, true, "/home/kristina/code/mahara/htdocs/lib/dml.php", 1578) at /home/kristina/code/mahara/htdocs/lib/errors.php:441
    error(8, "Array to string conversion", "/home/kristina/code/mahara/htdocs/lib/dml.php", 1578, array(size 4)) at Unknown:0
    implode(",", array(size 1)) at /home/kristina/code/mahara/htdocs/lib/dml.php:1578
    create_sql_exception_message(object(ADODB_Exception), "SELECT "username" FROM "usr" WHERE "id" = ? ", array(size 1)) at /home/kristina/code/mahara/htdocs/lib/dml.php:480
    get_recordset_sql("SELECT "username" FROM "usr" WHERE "id" = ? ", array(size 1)) at /home/kristina/code/mahara/htdocs/lib/dml.php:791
    get_field_sql("SELECT "username" FROM "usr" WHERE "id" = ? ", array(size 1)) at /home/kristina/code/mahara/htdocs/lib/dml.php:779
    get_field("usr", "username", "id", array(size 1)) at /home/kristina/code/mahara/htdocs/webservice/admin/webservicelogs.php:22

[WAR] d7 (lib/errors.php:747) Failed to get a recordset: postgres8 error: [-1: ERROR: invalid input syntax for integer: "Array"] in EXECUTE("SELECT "username" FROM "usr" WHERE "id" = ? ")
Command was: SELECT "username" FROM "usr" WHERE "id" = ? and values was (Array)
Call stack (most recent first):

    log_message("Failed to get a recordset: postgres8 error: [-1: E...", 8, true, true) at /home/kristina/code/mahara/htdocs/lib/errors.php:97
    log_warn("Failed to get a recordset: postgres8 error: [-1: E...") at /home/kristina/code/mahara/htdocs/lib/errors.php:747
    SQLException->__construct("Failed to get a recordset: postgres8 error: [-1: E...") at /home/kristina/code/mahara/htdocs/lib/dml.php:480
    get_recordset_sql("SELECT "username" FROM "usr" WHERE "id" = ? ", array(size 1)) at /home/kristina/code/mahara/htdocs/lib/dml.php:791
    get_field_sql("SELECT "username" FROM "usr" WHERE "id" = ? ", array(size 1)) at /home/kristina/code/mahara/htdocs/lib/dml.php:779
    get_field("usr", "username", "id", array(size 1)) at /home/kristina/code/mahara/htdocs/webservice/admin/webservicelogs.php:22

[WAR] d7 (lib/dml.php:480) Failed to get a recordset: postgres8 error: [-1: ERROR: invalid input syntax for integer: "Array"] in EXECUTE("SELECT "username" FROM "usr" WHERE "id" = ? ")
Command was: SELECT "username" FROM "usr" WHERE "id" = ? and values was (Array)
Call stack (most recent first):

    get_recordset_sql("SELECT "username" FROM "usr" WHERE "id" = ? ", array(size 1)) at /home/kristina/code/mahara/htdocs/lib/dml.php:791
    get_field_sql("SELECT "username" FROM "usr" WHERE "id" = ? ", array(size 1)) at /home/kristina/code/mahara/htdocs/lib/dml.php:779
    get_field("usr", "username", "id", array(size 1)) at /home/kristina/code/mahara/htdocs/webservice/admin/webservicelogs.php:22

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/5214

Robert Lyon (robertl-9)
Changed in mahara:
status: Confirmed → In Progress
assignee: nobody → Robert Lyon (robertl-9)
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5214
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/7ea48590d6ecb74e244a1193fa86d35f3bef94b3
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 7ea48590d6ecb74e244a1193fa86d35f3bef94b3
Author: Robert Lyon <email address hidden>
Date: Fri Sep 4 12:51:48 2015 +1200

Bug 1486766: Dealing with array of usernames with webservice search

The select2 username picker returns an array of user ids but the log
search can only handle one user so we only want the first of the array

behatnotneeded

Change-Id: I9efd12d73ecfb640e7a96332538aaa1f27d0176e
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
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.