Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-27934

Useless code

    XMLWordPrintable

    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.

        Attachments

          Activity

            People

            Assignee:
            poltawski Dan Poltawski
            Reporter:
            sunner Sunner Sun
            Integrator:
            Sam Hemelryk
            Tester:
            Aparup Banerjee
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

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