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

Document conversion task should fail if any document could not be converted

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.2, 3.5.7
    • Fix Version/s: None
    • Component/s: Assignment (2.2)
    • Testing Instructions:
      Hide

      If file conversions fails for some reason, code doesn't stop the execution and queue is cleaned so failed conversion can't be restarted

      1. Use Moodle 3.5
      2. Install attached pseudo async plugin fileconverter_example.zip  (copied from MDL-55528).
      3. Install ghostcript and unoconv on server 

        apt install ghostscript
         
        apt install unoconv
        

      1. Enable plugin in admin/settings.php?section=managefileconverterplugins
      2. Disable all other file converters
      3. Create assignment with file submission and enable annotations
      4. Submit file to assignment in format other than pdf - for example odt
      5. Run scheduled task

        php admin/tool/task/cli/schedule_task.php --execute='\assignfeedback_editpdf\task\convert_submissions'

      Expected behaviour: exception is thrown. Task can be restarted and process failed submission

      Actual behaviour: you will see error

      Conversion failed with error:Could not find readonly pages for grade 37342

      But code will keep execution and cleans up the queue, so task restart won't process failed submissions

      Show
      If file conversions fails for some reason, code doesn't stop the execution and queue is cleaned so failed conversion can't be restarted Use Moodle 3.5 Install attached pseudo async plugin fileconverter_example.zip  (copied from MDL-55528 ). Install ghostcript and unoconv on server  apt install ghostscript   apt install unoconv Enable plugin in admin/settings.php?section=managefileconverterplugins Disable all other file converters Create assignment with file submission and enable annotations Submit file to assignment in format other than pdf - for example odt Run scheduled task php admin/tool/task/cli/schedule_task.php --execute= '\assignfeedback_editpdf\task\convert_submissions' Expected behaviour: exception is thrown. Task can be restarted and process failed submission Actual behaviour: you will see error Conversion failed with error:Could not find readonly pages for grade 37342 But code will keep execution and cleans up the queue, so task restart won't process failed submissions
    • Affected Branches:
      MOODLE_35_STABLE
    • Pull 3.5 Branch:
      MDL-63718-throw-exception-when-conversion-failed-MOODLE_35_STABLE
    • Pull 3.6 Branch:
      MDL-63718-throw-exception-when-conversion-failed-MOODLE_36_STABLE
    • Pull 3.7 Branch:
      MDL-63718-throw-exception-when-conversion-failed-MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-63718-throw-exception-when-conversion-failed-master

      Description

      File: mod/assign/feedback/editpdf/classes/task/convert_submissions.php
      Function: execute()

      The bit of code that actually does the conversion is (for no clear reason) wrapped in a try..catch block. All it does is float a different error. 

      This is (IMO) both pointless and masks the real error if anything does go wrong.

      Suggest removing the try..catch

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 10 minutes
                  4h 10m