Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.4.3
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Assignment
    • Labels:
    • Rank:
      48524

      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.

        Activity

        Hide
        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 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
        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
        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 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 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 Wiese added a comment -

        Just noting that I plan on working on this tomorrow.

        Show
        Damyon Wiese added a comment - Just noting that I plan on working on this tomorrow.
        Hide
        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 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 Panning added a comment -

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

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

        Integrated (23, 24 & master), thanks!

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

        All good Damyon

        Show
        Jason Fowler added a comment - All good Damyon
        Hide
        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
        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: