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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.3
    • 2.3
    • Files API
    • MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • MDL-33587-delete-alias
    • 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.

      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...

            mudrd8mz David Mudrák (@mudrd8mz)
            mudrd8mz David Mudrák (@mudrd8mz)
            Dan Poltawski Dan Poltawski
            Dan Poltawski Dan Poltawski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.