Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.4.3
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide
      1. Create an instance of the old 'Advanced uploading of files' assignment with "Allow notes" enabled.
      2. Login as a student and add a note to your submission
      3. Login as an admin and unenrol the student
      4. Upgrade the assignment with the assignment upgrade tool
      5. Verify that the upgrade completes successfully.
      Show
      Create an instance of the old 'Advanced uploading of files' assignment with "Allow notes" enabled. Login as a student and add a note to your submission Login as an admin and unenrol the student Upgrade the assignment with the assignment upgrade tool Verify that the upgrade completes successfully.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38525-master

      Description

      Eloy reported an assignment upgrade exception with a null exception error message. "Could not convert assignment. Exception was: {$a}."

      Extra info: object(comment_exception)[4892]
      public 'errorcode' => string 'nopermissiontocomment' (length=21)
      public 'module' => string 'error' (length=5)
      public 'a' => null
      public 'link' => string '' (length=0)
      public 'debuginfo' => null
      protected 'message' => string 'You can't add comments' (length=22)
      private 'string' (Exception) => string '' (length=0)
      protected 'code' => int 0
      protected 'file' => string '/Users/stronk7/Sites/fp/moodle/comment/lib.php' (length=46)
      protected 'line' => int 613
      private 'trace' (Exception) =>

      So 2 things need fixing: Assignment upgrade code needs to handle a null exception->error and more testing on upload assignments with comments re: permissions to try and reproduce this bug.

        Gliffy Diagrams

          Activity

          Hide
          ryan.isd196 Ryan Panning added a comment -

          I also ran into this exact issue. Ended up changing line 273 in file /mod/assign/upgradelib.php to $log .= get_string('conversionexception', 'mod_assign', $exception->getMessage()); Is there any known fix or exact cause of the error? We're testing the upgrade from 1.9 to 2.4.

          Show
          ryan.isd196 Ryan Panning added a comment - I also ran into this exact issue. Ended up changing line 273 in file /mod/assign/upgradelib.php to $log .= get_string('conversionexception', 'mod_assign', $exception-> getMessage() ); Is there any known fix or exact cause of the error? We're testing the upgrade from 1.9 to 2.4.
          Hide
          bcoshyan Oshyan Greene added a comment -

          We have also run into this issue. Not clear on what Ryan's proposed change actually does. Does it actually fix it, or just show a non-null error message?

          In any case, hope this gets fixed ASAP. Thanks!

          Show
          bcoshyan Oshyan Greene added a comment - We have also run into this issue. Not clear on what Ryan's proposed change actually does. Does it actually fix it, or just show a non-null error message? In any case, hope this gets fixed ASAP. Thanks!
          Hide
          ryan.isd196 Ryan Panning added a comment -

          The change that I mentioned only fixes one part of the issue, basically fills in the {$a} part of the error so that you know what the root cause of the error is. It does not fix the root cause of "You can't add comments", so the assignments still have problems with the upgrade process.

          Show
          ryan.isd196 Ryan Panning added a comment - The change that I mentioned only fixes one part of the issue, basically fills in the {$a} part of the error so that you know what the root cause of the error is. It does not fix the root cause of "You can't add comments", so the assignments still have problems with the upgrade process.
          Hide
          damyon Damyon Wiese added a comment -

          Just noting that I plan on working on this tomorrow.

          Show
          damyon Damyon Wiese added a comment - Just noting that I plan on working on this tomorrow.
          Hide
          damyon Damyon Wiese added a comment -

          Ah! I think this is when there is a submission for a student with notes but the student is no longer enrolled in the course (so sneaky).

          Show
          damyon Damyon Wiese added a comment - Ah! I think this is when there is a submission for a student with notes but the student is no longer enrolled in the course (so sneaky).
          Hide
          ryan.isd196 Ryan Panning added a comment -

          I can verify that the assignments do update now, with your patches. Thanks!

          Show
          ryan.isd196 Ryan Panning added a comment - I can verify that the assignments do update now, with your patches. Thanks!
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Integrated (23, 24 & master), thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (23, 24 & master), thanks!
          Hide
          phalacee Jason Fowler added a comment -

          All good Damyon

          Show
          phalacee Jason Fowler added a comment - All good Damyon
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Your awesome contributions are now part of Moodle, your fav LMS out there.

          Closing this as fixed.

          Many thanks for all the hard work, ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Your awesome contributions are now part of Moodle, your fav LMS out there. Closing this as fixed. Many thanks for all the hard work, ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/13