Moodle
  1. Moodle
  2. MDL-41907

Overwriting a file should maintain the original sortorder

    Details

    • Rank:
      53080

      Description

      When overwriting a file, the sortorder field is lost. In particular, this causes the "Main File" setting for File Resources to be lost.

        Issue Links

          Activity

          Hide
          Eric Merrill added a comment -

          I've added the patch, but I'm really not sure how to write unit test for it, and the existing tests covering this area seem to be light to nonexistent. I'm open to suggestions.

          I'm also not sure who should be pulled in to review or comment on this...

          Show
          Eric Merrill added a comment - I've added the patch, but I'm really not sure how to write unit test for it, and the existing tests covering this area seem to be light to nonexistent. I'm open to suggestions. I'm also not sure who should be pulled in to review or comment on this...
          Hide
          Marina Glancy added a comment -

          Hi Eric, patch looks very good.
          BTW we don't use the field 'sortorder' for anything else except main file in resource

          Show
          Marina Glancy added a comment - Hi Eric, patch looks very good. BTW we don't use the field 'sortorder' for anything else except main file in resource
          Hide
          Marina Glancy added a comment -

          There are no unittests in this area I'm afraid. It'd be too difficult to create new just for this small change, so I'm submitting this for integration for you.
          Thanks a lot for working on it

          Show
          Marina Glancy added a comment - There are no unittests in this area I'm afraid. It'd be too difficult to create new just for this small change, so I'm submitting this for integration for you. Thanks a lot for working on it
          Hide
          Eric Merrill added a comment -

          Thanks for the feedback and submission Marina!

          Show
          Eric Merrill added a comment - Thanks for the feedback and submission Marina!
          Hide
          Sam Hemelryk added a comment -

          Thanks Eric this has been integrated now.

          Show
          Sam Hemelryk added a comment - Thanks Eric this has been integrated now.
          Hide
          David Monllaó added a comment -

          It passes, tested in 24, 25 and master

          Show
          David Monllaó added a comment - It passes, tested in 24, 25 and master
          Hide
          Marina Glancy added a comment -

          And THANK YOU again for making Moodle better every day!

          Another weekly release has been released.

          Show
          Marina Glancy added a comment - And THANK YOU again for making Moodle better every day! Another weekly release has been released.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: