Moodle
  1. Moodle
  2. MDL-28559

Advanced uploading of files causes Coding Error when assigned as non-editing-teacher

    Details

    • Testing Instructions:
      Hide

      1. Create an advanced file upload assignment in a course. Accept all defaults
      2. Add a user as a non-editing-teacher to the course
      3. Log in as that non-editing-teacher
      4. Access the assignment
      5. Check to make sure the display is the same as for the teacher/admin - no ability to upload a file and no "Send for marking" button at the bottom of the page

      Show
      1. Create an advanced file upload assignment in a course. Accept all defaults 2. Add a user as a non-editing-teacher to the course 3. Log in as that non-editing-teacher 4. Access the assignment 5. Check to make sure the display is the same as for the teacher/admin - no ability to upload a file and no "Send for marking" button at the bottom of the page
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull Master Branch:
      master_MDL-28559
    • Rank:
      18245

      Description

      To reproduce....

      1. Create an advanced file upload assignment in a course. Accept all defaults
      2. Add a user as a non-editing-teacher to the course
      3. Log in as that non-editing-teacher
      4. Access the assignment
      5. Note "Send for marking" button at the bottom of the page (I think this is spurious)
      6. Click the "send for marking" button and then "Conitinue"

      Coding error and....

      Stack trace:
      line 913 of /lib/dml/pgsql_native_moodle_database.php: coding_exception thrown
      line 976 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->update_record_raw()
      line 665 of /mod/assignment/type/upload/assignment.class.php: call to pgsql_native_moodle_database->update_record()
      line 419 of /mod/assignment/type/upload/assignment.class.php: call to assignment_upload->finalize()
      line 44 of /mod/assignment/upload.php: call to assignment_upload->upload()
      Output buffer: <br /> <b>Notice</b>: Trying to get property of non-object in <b>/var/www/moodle2/mod/assignment/type/upload/assignment.class.php</b> on line <b>661</b><br />

      This is -
      <code php>
      $updated->id = $submission->id;
      </code>

      on my install (build 2011033004.00)

        Activity

        Hide
        Howard Miller added a comment -

        We also had a site connected to Mahara and it was displaying the "send to portfolio" button too (for the non-editing-teacher) so it looks like the capabilities for that role are wrong or are not getting checked properly.

        Show
        Howard Miller added a comment - We also had a site connected to Mahara and it was displaying the "send to portfolio" button too (for the non-editing-teacher) so it looks like the capabilities for that role are wrong or are not getting checked properly.
        Hide
        Michael Blake added a comment -

        This issue is affecting a MP client. Please give it priority.

        Show
        Michael Blake added a comment - This issue is affecting a MP client. Please give it priority.
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this.

        I have been able to replicate this.

        I've put it on our backlog and we'll try to get to it as soon as we can.

        Show
        Michael de Raadt added a comment - Thanks for reporting this. I have been able to replicate this. I've put it on our backlog and we'll try to get to it as soon as we can.
        Hide
        Dan Marsden added a comment -

        The old code also displays irrelevant information to enrolled users that can't submit and haven't submitted any files previously- nofiles/nofilesyet style messages that students see before they have submitted a file - so I've hidden that as well so it displays the same as it does to the teacher/admin.

        But.... If the user is enrolled and has previously submitted files - perhaps as they were previously a student and are now a tutor or if the teacher/admin has disabled the ability to upload by using override permissions somehow (not sure why they'd do this) - it still shows the files the user has uploaded. (this is how it was working anyway)

        Show
        Dan Marsden added a comment - The old code also displays irrelevant information to enrolled users that can't submit and haven't submitted any files previously- nofiles/nofilesyet style messages that students see before they have submitted a file - so I've hidden that as well so it displays the same as it does to the teacher/admin. But.... If the user is enrolled and has previously submitted files - perhaps as they were previously a student and are now a tutor or if the teacher/admin has disabled the ability to upload by using override permissions somehow (not sure why they'd do this) - it still shows the files the user has uploaded. (this is how it was working anyway)
        Hide
        Eloy Lafuente (stronk7) added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Sam Hemelryk added a comment -

        Again spot on thanks Dan - this has been integrated now

        Show
        Sam Hemelryk added a comment - Again spot on thanks Dan - this has been integrated now
        Hide
        Jason Fowler added a comment -

        All working fine

        Show
        Jason Fowler added a comment - All working fine
        Hide
        Eloy Lafuente (stronk7) added a comment -

        And this has been sent upstream (already available @ git and cvs repos). Many, many thanks!

        Closing as fixed, ciao

        Show
        Eloy Lafuente (stronk7) added a comment - And this has been sent upstream (already available @ git and cvs repos). Many, many thanks! Closing as fixed, ciao

          People

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

            Dates

            • Created:
              Updated:
              Resolved: