Moodle
  1. Moodle
  2. MDL-33547

In 2.3 Assignments clicking the "Export to portfolio" link generates an exception

    Details

    • Testing Instructions:
      Hide

      To recreate:
      This test requires the following:

      • Portfolios and the file download and Google Docs portfolio plugins to be enabled for the site
      • A course containing a 2.3 single file assignment and multiple files assignment
      • A Google Docs account for use in testing
      1. Login as a student, access the course and make submissions for each of the two assignments.
      2. For each assignment:
        • click the "Export to portfolio" link,
        • select "File download" from the "Select destination" dropdown,
        • click Next and select "File" from the "Available export formats" dropdown.
        • click Next.

      Expected result:

      • The files are exported successfully.

      Actual result:

      • Moodle throws the exception displayed above.
      Show
      To recreate: This test requires the following: Portfolios and the file download and Google Docs portfolio plugins to be enabled for the site A course containing a 2.3 single file assignment and multiple files assignment A Google Docs account for use in testing Login as a student, access the course and make submissions for each of the two assignments. For each assignment: click the "Export to portfolio" link, select "File download" from the "Select destination" dropdown, click Next and select "File" from the "Available export formats" dropdown. click Next. Expected result: The files are exported successfully. Actual result: Moodle throws the exception displayed above.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
    • Rank:
      41475

      Description

      When I try to export to portfolio using the "Export to portfolio" link; Moodle throws the exception:

      Invalid call to get_sha1_file - either single or multifiles must be set
      
      More information about this error
      Debug info:
      Error code: invalidsha1file
      Stack trace:
      
      line 982 of /lib/portfoliolib.php: portfolio_export_exception thrown
      line 239 of /lib/portfolio/exporter.php: call to portfolio_export_rethrow_exception()
      line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()
      line 268 of /portfolio/add.php: call to portfolio_exporter->process_stage()
      

      I have tested this with 2.2 and it works fine in both 2.3 file assignment sub-types.

        Issue Links

          Activity

          Hide
          Tim Barker added a comment -

          Tried this with Google docs and the same thing happened.

          Show
          Tim Barker added a comment - Tried this with Google docs and the same thing happened.
          Hide
          Dan Poltawski added a comment -

          Assignign to Damyon.

          Show
          Dan Poltawski added a comment - Assignign to Damyon.
          Hide
          Tim Barker added a comment -

          It works fine with individual files and the green portfolio icon, this is only a problem with the "Export to portfolio" link in NEW 2.3 assignments.

          Show
          Tim Barker added a comment - It works fine with individual files and the green portfolio icon, this is only a problem with the "Export to portfolio" link in NEW 2.3 assignments.
          Hide
          Damyon Wiese added a comment -

          I have fixed the specific issue with the new assignment module - I am still seeing an error when exporting multiple files to google with both mod_assignment and mod_assign which suggests there is still an issue with the google portfolio plugin.

          • Damyon
          Show
          Damyon Wiese added a comment - I have fixed the specific issue with the new assignment module - I am still seeing an error when exporting multiple files to google with both mod_assignment and mod_assign which suggests there is still an issue with the google portfolio plugin. Damyon
          Hide
          Dan Poltawski added a comment -

          Thanks Damyon, bringing this straight into integration.

          Show
          Dan Poltawski added a comment - Thanks Damyon, bringing this straight into integration.
          Hide
          Dan Poltawski added a comment -

          I've integrated this

          Show
          Dan Poltawski added a comment - I've integrated this
          Hide
          Dan Poltawski added a comment -

          Manually passing, to be done by QA test. thanks.

          Show
          Dan Poltawski added a comment - Manually passing, to be done by QA test. thanks.
          Hide
          Dan Poltawski added a comment -

          Actually, putting into the 'waiting for testing' state, because the QA test is blocked by the other google docs issue.

          Show
          Dan Poltawski added a comment - Actually, putting into the 'waiting for testing' state, because the QA test is blocked by the other google docs issue.
          Hide
          Dan Poltawski added a comment -

          Removed the mdlqa label frm here, as its now in MDL-33551

          Show
          Dan Poltawski added a comment - Removed the mdlqa label frm here, as its now in MDL-33551
          Hide
          Frédéric Massart added a comment -

          The test is fine when uploading one file.
          The test fails with more than one file.
          I have tried multiple types of documents.

          This exception is raised:

          Debug info: 
          Error code: Cantpostupload
          $a contents: 
          Stack trace: 
          line 982 of /lib/portfoliolib.php: portfolio_export_exception thrown
          line 247 of /lib/portfolio/exporter.php: call to portfolio_export_rethrow_exception()
          line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()
          line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()
          line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()
          line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()
          line 268 of /portfolio/add.php: call to portfolio_exporter->process_stage()
          Output buffer: <div class="notifytiny">A third party exception was thrown during portfolio export (moodle_exception). Caught and rethrown but this should really be fixed<ul style="text-align: left"><li>line 245 of /lib/portfolio/exporter.php: call to debugging()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 268 of /portfolio/add.php: call to portfolio_exporter->process_stage()</li></ul></div><div class="notifytiny">exception 'moodle_exception' with message 'error/Cantpostupload' in /home/fred/www/repositories/testing_master/moodle/lib/googleapi.php:140 Stack trace: #0 /home/fred/www/repositories/testing_master/moodle/portfolio/googledocs/lib.php(58): google_docs->send_file(Object(stored_file)) #1 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(502): portfolio_plugin_googledocs->send_package() #2 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(227): portfolio_exporter->process_stage_send() #3 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(233): portfolio_exporter->process_stage(5) #4 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(233): portfolio_exporter->process_stage(4) #5 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(233): portfolio_exporter->process_stage(3) #6 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(233): portfolio_exporter->process_stage(2) #7 /home/fred/www/repositories/testing_master/moodle/portfolio/add.php(268): portfolio_exporter->process_stage(1, false) #8 {main}<ul style="text-align: left"><li>line 246 of /lib/portfolio/exporter.php: call to debugging()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 268 of /portfolio/add.php: call to portfolio_exporter->process_stage()</li></ul></div>
          

          Note: When I clicked on 'Export to portfolio' with only one file, I did not see 'File download' but just a confirm button.

          Show
          Frédéric Massart added a comment - The test is fine when uploading one file. The test fails with more than one file. I have tried multiple types of documents. This exception is raised: Debug info: Error code: Cantpostupload $a contents: Stack trace: line 982 of /lib/portfoliolib.php: portfolio_export_exception thrown line 247 of /lib/portfolio/exporter.php: call to portfolio_export_rethrow_exception() line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage() line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage() line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage() line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage() line 268 of /portfolio/add.php: call to portfolio_exporter->process_stage() Output buffer: <div class="notifytiny">A third party exception was thrown during portfolio export (moodle_exception). Caught and rethrown but this should really be fixed<ul style="text-align: left"><li>line 245 of /lib/portfolio/exporter.php: call to debugging()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 268 of /portfolio/add.php: call to portfolio_exporter->process_stage()</li></ul></div><div class="notifytiny">exception 'moodle_exception' with message 'error/Cantpostupload' in /home/fred/www/repositories/testing_master/moodle/lib/googleapi.php:140 Stack trace: #0 /home/fred/www/repositories/testing_master/moodle/portfolio/googledocs/lib.php(58): google_docs->send_file(Object(stored_file)) #1 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(502): portfolio_plugin_googledocs->send_package() #2 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(227): portfolio_exporter->process_stage_send() #3 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(233): portfolio_exporter->process_stage(5) #4 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(233): portfolio_exporter->process_stage(4) #5 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(233): portfolio_exporter->process_stage(3) #6 /home/fred/www/repositories/testing_master/moodle/lib/portfolio/exporter.php(233): portfolio_exporter->process_stage(2) #7 /home/fred/www/repositories/testing_master/moodle/portfolio/add.php(268): portfolio_exporter->process_stage(1, false) #8 {main}<ul style="text-align: left"><li>line 246 of /lib/portfolio/exporter.php: call to debugging()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 233 of /lib/portfolio/exporter.php: call to portfolio_exporter->process_stage()</li><li>line 268 of /portfolio/add.php: call to portfolio_exporter->process_stage()</li></ul></div> Note: When I clicked on 'Export to portfolio' with only one file, I did not see 'File download' but just a confirm button.
          Hide
          Dan Poltawski added a comment -

          Fred: see damyons comment:

          'I have fixed the specific issue with the new assignment module - I am still seeing an error when exporting multiple files to google with both mod_assignment and mod_assign which suggests there is still an issue with the google portfolio plugin.'

          This problem is to be addressed in the linked bug. Closing.

          Show
          Dan Poltawski added a comment - Fred: see damyons comment: 'I have fixed the specific issue with the new assignment module - I am still seeing an error when exporting multiple files to google with both mod_assignment and mod_assign which suggests there is still an issue with the google portfolio plugin.' This problem is to be addressed in the linked bug. Closing.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          We could celebrate it today... but better if we perform a bigger party after releasing Moodle 2.3.

          Print this message and come to Perth that day, it's valid for one beer, wine, coke or... water, as you wish.

          Many thanks for your collaboration!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - We could celebrate it today... but better if we perform a bigger party after releasing Moodle 2.3. Print this message and come to Perth that day, it's valid for one beer, wine, coke or... water, as you wish. Many thanks for your collaboration! Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: