Moodle
  1. Moodle
  2. MDL-30709

Recent files option does not work

    Details

    • Testing Instructions:
      Hide
      1. Create an upload assignment (type = uploadsingle)
      2. Login as student
      3. Upload a file to the assignment
      4. Go someplace else and attempt to choose that uploaded file in the file picker under recent files.
      5. Should be able to successfully use the recent file.
      1. Create an upload assignment (type = upload)
      2. Login as student
      3. Upload a file to the assignment
      4. Go someplace else and attempt to choose that uploaded file in the file picker under recent files.
      5. Should be able to successfully use the recent file.
      Show
      Create an upload assignment (type = uploadsingle) Login as student Upload a file to the assignment Go someplace else and attempt to choose that uploaded file in the file picker under recent files. Should be able to successfully use the recent file. Create an upload assignment (type = upload) Login as student Upload a file to the assignment Go someplace else and attempt to choose that uploaded file in the file picker under recent files. Should be able to successfully use the recent file.
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
      git@github.com:marinaglancy/moodle.git
    • Pull Master Branch:
      wip-MDL-30709-master
    • Rank:
      33550

      Description

      This appears to be the exact same problem as MDL-30214, but for Assignment. Most likely have to create an assignment_get_file_info() method.

      Other modules should be tested to see if they must implement MODNAME_get_file_info() method as well.

        Issue Links

          Activity

          Mark Nielsen created issue -
          Mark Nielsen made changes -
          Field Original Value New Value
          Link This issue discovered while testing MDL-30214 [ MDL-30214 ]
          Mark Nielsen made changes -
          Description This appears to be the exact same problem as MDL-30214, but for Assignment. Most likely have to create an assignment_get_file_info() method. This appears to be the exact same problem as MDL-30214, but for Assignment. Most likely have to create an assignment_get_file_info() method.

          _Other modules should be tested to see if they must implement MODNAME_get_file_info() method as well._
          Labels moodlerooms partner
          Mark Nielsen made changes -
          Priority Minor [ 4 ] Critical [ 2 ]
          Mark Nielsen made changes -
          Fix Version/s 2.1.4 [ 11452 ]
          Affects Version/s 2.1.3 [ 11251 ]
          Affects Version/s 2.2.1 [ 11456 ]
          Hide
          Michael de Raadt added a comment -

          Thanks for reporting that.

          Feel free to help us work on the issue.

          Show
          Michael de Raadt added a comment - Thanks for reporting that. Feel free to help us work on the issue.
          Michael de Raadt made changes -
          Fix Version/s STABLE backlog [ 10463 ]
          Fix Version/s 2.1.4 [ 11452 ]
          Labels moodlerooms partner moodlerooms partner triaged
          Assignee moodle.com [ moodle.com ] Marina Glancy [ marina ]
          Hide
          Michael de Raadt added a comment -

          Marina, it would be good if you could have a look at this.

          Show
          Michael de Raadt added a comment - Marina, it would be good if you could have a look at this.
          Hide
          Marina Glancy added a comment - - edited

          Fixed bug with inserting files from Recent files repository

          Two parts of changes: in assignment module function assignment_get_file_info was missing;
          and when populating the list of recent files the function get_file_info was not called, which caused populating the list of recent files with the files that could not later be inserted

          Show
          Marina Glancy added a comment - - edited Fixed bug with inserting files from Recent files repository Two parts of changes: in assignment module function assignment_get_file_info was missing; and when populating the list of recent files the function get_file_info was not called, which caused populating the list of recent files with the files that could not later be inserted
          Marina Glancy made changes -
          Status Open [ 1 ] Waiting for integration review [ 10010 ]
          Pull Master Diff URL https://github.com/marinaglancy/moodle/compare/master...wip-MDL-30709-master
          Pull Master Branch wip-MDL-30709-master
          Pull from Repository git@github.com:marinaglancy/moodle.git
          Pull 2.1 Branch wip-MDL-30709-MOODLE_21_STABLE
          Pull 2.2 Diff URL https://github.com/marinaglancy/moodle/compare/MOODLE_22_STABLE...wip-MDL-30709-MOODLE_22_STABLE
          Pull 2.1 Diff URL https://github.com/marinaglancy/moodle/compare/MOODLE_21_STABLE...wip-MDL-30709-MOODLE_21_STABLE
          Pull 2.2 Branch wip-MDL-30709-MOODLE_22_STABLE
          Eloy Lafuente (stronk7) made changes -
          Currently in integration Yes [ 10041 ]
          Sam Hemelryk made changes -
          Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
          Integrator samhemelryk
          Hide
          Sam Hemelryk added a comment -

          Thanks Marina this has been integrated now.

          I did make one more commit to fix up the phpdocs for the new function however.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Thanks Marina this has been integrated now. I did make one more commit to fix up the phpdocs for the new function however. Cheers Sam
          Sam Hemelryk made changes -
          Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
          Fix Version/s 2.1.5 [ 11553 ]
          Fix Version/s 2.2.2 [ 11552 ]
          Fix Version/s STABLE backlog [ 10463 ]
          Glenn Ansley made changes -
          Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
          Tester blepoxp
          Glenn Ansley made changes -
          Status Testing in progress [ 10011 ] Waiting for testing [ 10005 ]
          Hide
          Andrew Nicols added a comment -

          Just a point I came across whilst investigating this issue, it looks like the function should really be named mod_MODNAME_get_file_info - I assume that the MODNAME_get_file_info option will be deprecated at some point given the variable name, but there's not comment to that effect.

                  $functionname     = 'mod_'.$this->modname.'_get_file_info';
                  $functionname_old = $this->modname.'_get_file_info';
          
                  if (function_exists($functionname)) {
                      return $functionname($this->browser, $this->areas, $this->course, $this->cm, $this->context, $filearea, $itemid, $filepath, $filename);
                  } else if (function_exists($functionname_old)) {
                      return $functionname_old($this->browser, $this->areas, $this->course, $this->cm, $this->context, $filearea, $itemid, $filepath, $filename);
                  }   
          

          Might require another issue after testing is complete

          Show
          Andrew Nicols added a comment - Just a point I came across whilst investigating this issue, it looks like the function should really be named mod_MODNAME_get_file_info - I assume that the MODNAME_get_file_info option will be deprecated at some point given the variable name, but there's not comment to that effect. $functionname = 'mod_'.$ this ->modname.'_get_file_info'; $functionname_old = $ this ->modname.'_get_file_info'; if (function_exists($functionname)) { return $functionname($ this ->browser, $ this ->areas, $ this ->course, $ this ->cm, $ this ->context, $filearea, $itemid, $filepath, $filename); } else if (function_exists($functionname_old)) { return $functionname_old($ this ->browser, $ this ->areas, $ this ->course, $ this ->cm, $ this ->context, $filearea, $itemid, $filepath, $filename); } Might require another issue after testing is complete
          Hide
          Sam Hemelryk added a comment -

          Thanks for spotting that Andrew, given this is going into stable branches I am going to make an additional commit now to rename the function to mod_assignment_get_file_info.
          Indeed we are trying to break the habit of not prefixing module callbacks with mod_, good catch!

          Show
          Sam Hemelryk added a comment - Thanks for spotting that Andrew, given this is going into stable branches I am going to make an additional commit now to rename the function to mod_assignment_get_file_info. Indeed we are trying to break the habit of not prefixing module callbacks with mod_, good catch!
          Hide
          Sam Hemelryk added a comment -

          OK all branches updated with the renamed function: ready for testing

          Show
          Sam Hemelryk added a comment - OK all branches updated with the renamed function: ready for testing
          Michael de Raadt made changes -
          Peer reviewer rajeshtaneja
          Michael de Raadt made changes -
          Peer reviewer rajeshtaneja blepoxp
          Tester blepoxp rajeshtaneja
          Rajesh Taneja made changes -
          Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
          Hide
          Rajesh Taneja added a comment -

          Thanks Andrew, Sam and Marina.
          Works great.

          Show
          Rajesh Taneja added a comment - Thanks Andrew, Sam and Marina. Works great.
          Rajesh Taneja made changes -
          Status Testing in progress [ 10011 ] Tested [ 10006 ]
          Andrew Nicols made changes -
          Link This issue testing discovered MDL-31661 [ MDL-31661 ]
          Hide
          Eloy Lafuente (stronk7) added a comment -

          It is late here and I'm very tired but I didn't want to go to sleep before expressing my admiration for your amazing collaboration. Thanks!

          Closing as fixed, heading to zzzZZZzzz, niao

          Show
          Eloy Lafuente (stronk7) added a comment - It is late here and I'm very tired but I didn't want to go to sleep before expressing my admiration for your amazing collaboration. Thanks! Closing as fixed, heading to zzzZZZzzz, niao
          Eloy Lafuente (stronk7) made changes -
          Status Tested [ 10006 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Currently in integration Yes [ 10041 ]
          Marina Glancy made changes -
          Link This issue has been marked as being related by MDL-31738 [ MDL-31738 ]
          Eloy Lafuente (stronk7) made changes -
          Integration date 17/Feb/12
          Marina Glancy made changes -
          Link This issue has been marked as being related by MDL-32378 [ MDL-32378 ]

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: