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

'Force download' gives 'Error file not found'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Resource
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      There is a typo on the following lines:

      /mod/resource/lib.php, line 276:
      $path = '/'.$context->id.'/resource_content/'.$resource->revision.$mainfile->get_filename();

      /mod/resource/view.php, line 78
      $path = '/'.$context->id.'/resource_content/'.$resource->revision.$file->get_filepath().$file->get_filename();

      In both cases, $resource->revision, should be followed by .'/'. to give the full lines:

      $path = '/'.$context->id.'/resource_content/'.$resource->revision.'/'.$mainfile->get_filename();
      $path = '/'.$context->id.'/resource_content/'.$resource->revision.'/'.$file->get_filepath().$file->get_filename();

      This is causing a 'file not found' error when trying to click on a link to a File resource that has been to 'Force download'

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            davosmith Davo Smith
            Tester:
            Nobody
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10