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

Deleting a single alias to a file unlinks all other aliases to that file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Files API
    • Labels:
    • Testing Instructions:
      Hide

      Testing difficulty: easy

      1. Upload a file into the root of your Private files are, let's call it image.jpg. Save changes.
      2. Create folders A and B in your Private files
      3. Go into the A folder and press Add the file. Browse via Private files repo to that just uploaded image.jpg and add it as a link (not copy). Save changes.
      4. Go into the B folder and repeat the step 3. (so now there is the file in the root of Private files and it has two symlinks in A and B folders)
      5. Go into the A folder agains and delete the alias.
      6. TEST: Make sure the alias in the B folder has not been affected by this: it is still displayed as a link.

      Show
      Testing difficulty: easy 1. Upload a file into the root of your Private files are, let's call it image.jpg. Save changes. 2. Create folders A and B in your Private files 3. Go into the A folder and press Add the file. Browse via Private files repo to that just uploaded image.jpg and add it as a link (not copy). Save changes. 4. Go into the B folder and repeat the step 3. (so now there is the file in the root of Private files and it has two symlinks in A and B folders) 5. Go into the A folder agains and delete the alias. 6. TEST: Make sure the alias in the B folder has not been affected by this: it is still displayed as a link.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-33587-delete-alias

      Description

      While looking at the code I realized this regression of MDL-33330. In the method stored_file::delete_reference() there is

      $DB->delete_records('files_reference', array('id'=>$this->file_record->referencefileid));

      that can't be done now as there can be other stored files referring to that record. It was valid only in the 1:1 setup. I am pretty sure Petr mentioned this problem before but i did not understand him that time...

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Jun/12