Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.2
    • Component/s: Assignment (2.2)
    • Labels:
    • Testing Instructions:
      Hide

      Test that the upload assignment type can still be used files can be uploaded and no problems exist.

      Show
      Test that the upload assignment type can still be used files can be uploaded and no problems exist.
    • Workaround:
      Hide

      — a/mod/assignment/type/upload/assignment.class.php
      +++ b/mod/assignment/type/upload/assignment.class.php
      @@ -525,7 +525,6 @@ class assignment_upload extends assignment_base {

      $returnurl = new moodle_url('/mod/assignment/view.php', array('id'=>$this->cm->id));
      $submission = $this->get_submission($USER->id);

      • $filecount = $this->count_user_files($submission->id);

      if (!$this->can_upload_file($submission)) {
      $this->view_header(get_string('upload'));

      Show
      — a/mod/assignment/type/upload/assignment.class.php +++ b/mod/assignment/type/upload/assignment.class.php @@ -525,7 +525,6 @@ class assignment_upload extends assignment_base { $returnurl = new moodle_url('/mod/assignment/view.php', array('id'=>$this->cm->id)); $submission = $this->get_submission($USER->id); $filecount = $this->count_user_files($submission->id); if (!$this->can_upload_file($submission)) { $this->view_header(get_string('upload'));
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      In file mod/assignment/type/upload/assignment.class.php, function upload_file(), there is one line of useless code:

      $filecount = $this->count_user_files($submission->id);

      $filecount is not used in the following code of this function.

        Gliffy Diagrams

          Activity

          Hide
          salvetore Michael de Raadt added a comment -

          Thanks for reporting this.

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

          Show
          salvetore Michael de Raadt added a comment - Thanks for reporting this. I've put it on our backlog and we'll try to get to it as soon as we can.
          Hide
          cfulton Charles Fulton added a comment -

          If anyone's wondering that code is left over from the original upload class, which was completely rewritten in 2006: https://github.com/moodle/moodle/commit/55b4d096372a8a748925d63cb8df21aae9ee0a90#mod/assignment/type/upload/assignment.class.php.

          Show
          cfulton Charles Fulton added a comment - If anyone's wondering that code is left over from the original upload class, which was completely rewritten in 2006: https://github.com/moodle/moodle/commit/55b4d096372a8a748925d63cb8df21aae9ee0a90#mod/assignment/type/upload/assignment.class.php .
          Hide
          poltawski Dan Poltawski added a comment -

          Hi Sun,

          Thanks a lot for this report and for the patch/pull branches.

          I am going to submit a pull request for this to be integrated.

          Just some comments for future:

          • The pull repository you specified was your writeable repository rather than the read-only repository that we could pull from.
          • It is useful to include a 'component' in the commit message and also the bug number (I appreciate this is difficult when you are creating the bug with the commit already crafted)

          Submitting pull request now..

          thanks,
          Dan

          Show
          poltawski Dan Poltawski added a comment - Hi Sun, Thanks a lot for this report and for the patch/pull branches. I am going to submit a pull request for this to be integrated. Just some comments for future: The pull repository you specified was your writeable repository rather than the read-only repository that we could pull from. It is useful to include a 'component' in the commit message and also the bug number (I appreciate this is difficult when you are creating the bug with the commit already crafted) Submitting pull request now.. thanks, Dan
          Hide
          poltawski Dan Poltawski added a comment -

          I have submitted this for master only, since I don't think its worth doing on stable branches.

          Show
          poltawski Dan Poltawski added a comment - I have submitted this for master only, since I don't think its worth doing on stable branches.
          Hide
          samhemelryk Sam Hemelryk added a comment -

          Thanks guys, this has been integrated now.

          Cheers
          Sam

          Show
          samhemelryk Sam Hemelryk added a comment - Thanks guys, this has been integrated now. Cheers Sam
          Hide
          nebgor Aparup Banerjee added a comment -

          no problems seen, wfm!

          Show
          nebgor Aparup Banerjee added a comment - no problems seen, wfm!
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Moodle's git/cvs repositories have been updated with this piece of art! Thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Moodle's git/cvs repositories have been updated with this piece of art! Thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/11