Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Future Dev
    • Fix Version/s: None
    • Component/s: Survey 2
    • Labels:
      None
    • Rank:
      45252

      Description

      Just downloaded Survey2/"collection" mod from github. $module->version = 2012101103
      on Moodle 2.4 (master) version Moodle 2.4dev (Build: 20121101)
      Windows 7. Moodle database: MySQL
      localhost
      I can create questions, but Impossible to take a survey, always getting error message:

      Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ra
      JOIN mdl_user u ON u.id = ra.userid' at line 5
      SELECT DISTINCT ra.userid, u.firstname, u.lastname, u.email
      FROM (SELECT *
      FROM mdl_role_assignments
      WHERE contextid = 28
      AND roleid IN (Array) ra
      JOIN mdl_user u ON u.id = ra.userid
      [array (
      )]
      Error code: dmlreadexception
      Stack trace:
      line 424 of \lib\dml\moodle_database.php: dml_read_exception thrown
      line 960 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1972 of \mod\collection\locallib.php: call to mysqli_native_moodle_database->get_recordset_sql()
      line 146 of \mod\collection\beforepage.php: call to collection_notifyroles()
      line 58 of \mod\collection\view.php: call to include_once()

        Activity

        Hide
        Daniele Cordella added a comment -

        sending email to roles?
        I'll check as soon as possible.
        Thanks Joseph.

        Show
        Daniele Cordella added a comment - sending email to roles? I'll check as soon as possible. Thanks Joseph.
        Hide
        Daniele Cordella added a comment -

        You are absolutely right, Joseph.
        100% my fault.
        I just fixed and uploaded it.
        I tested it with a course not divided into groups, submitting a collection as admin and as enrolled urser.
        I apologise.

        Show
        Daniele Cordella added a comment - You are absolutely right, Joseph. 100% my fault. I just fixed and uploaded it. I tested it with a course not divided into groups, submitting a collection as admin and as enrolled urser. I apologise.
        Hide
        Daniele Cordella added a comment -

        Please Joseph, don't let me close the issue to find, tomorrow, that you are not satisfied and you reopened it.
        If you feel the bug has been fixed, please close this issue.
        Thanks for the report and thanks for testing.
        Daniele

        Show
        Daniele Cordella added a comment - Please Joseph, don't let me close the issue to find, tomorrow, that you are not satisfied and you reopened it. If you feel the bug has been fixed, please close this issue. Thanks for the report and thanks for testing. Daniele
        Hide
        Joseph Rézeau added a comment -

        @Daniele,
        I've updated my code to your github and still getting error message when at least one role is selected for email notification.

        Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ra
        JOIN mdl_user u ON u.id = ra.userid' at line 5
        SELECT DISTINCT ra.userid, u.firstname, u.lastname, u.email
        FROM (SELECT *
        FROM mdl_role_assignments
        WHERE contextid = 28
        AND roleid IN () ra
        JOIN mdl_user u ON u.id = ra.userid
        [array (
        )]
        Error code: dmlreadexception
        Stack trace:
        line 424 of \lib\dml\moodle_database.php: dml_read_exception thrown
        line 960 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
        line 1973 of \mod\collection\locallib.php: call to mysqli_native_moodle_database->get_recordset_sql()
        line 147 of \mod\collection\beforepage.php: call to collection_notifyroles()
        line 58 of \mod\collection\view.php: call to include_once()
        Output buffer: <br /> <b>Warning</b>: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in <b>M:\server\htdocs\moodle24\moodle\mod\collection\locallib.php</b> on line <b>1971</b><br />

        Show
        Joseph Rézeau added a comment - @Daniele, I've updated my code to your github and still getting error message when at least one role is selected for email notification. Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ra JOIN mdl_user u ON u.id = ra.userid' at line 5 SELECT DISTINCT ra.userid, u.firstname, u.lastname, u.email FROM (SELECT * FROM mdl_role_assignments WHERE contextid = 28 AND roleid IN () ra JOIN mdl_user u ON u.id = ra.userid [array ( )] Error code: dmlreadexception Stack trace: line 424 of \lib\dml\moodle_database.php: dml_read_exception thrown line 960 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1973 of \mod\collection\locallib.php: call to mysqli_native_moodle_database->get_recordset_sql() line 147 of \mod\collection\beforepage.php: call to collection_notifyroles() line 58 of \mod\collection\view.php: call to include_once() Output buffer: <br /> <b>Warning</b>: implode() [<a href='function.implode'>function.implode</a>] : Invalid arguments passed in <b>M:\server\htdocs\moodle24\moodle\mod\collection\locallib.php</b> on line <b>1971</b><br />
        Hide
        Daniele Cordella added a comment -

        As far as I know, I just uploaded to my github the fix.
        Thank you Joseph for your patience.

        Show
        Daniele Cordella added a comment - As far as I know, I just uploaded to my github the fix. Thank you Joseph for your patience.
        Hide
        Joseph Rézeau added a comment -

        This is working OK now, you can close my bug report.
        Thanks Daniele!

        Show
        Joseph Rézeau added a comment - This is working OK now, you can close my bug report. Thanks Daniele!
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Closing.

        Show
        Eloy Lafuente (stronk7) added a comment - Closing.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: