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

The function course_delete_module should return an untranslated errorcode for the exceptions for the web service.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: None
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course module.
      2. Edit the function course_delete_module in course/lib.php by copying the first occurrence of "throw new exception ..." in this issues diff and placing it after the declaration of $modulename.
      3. Attempt to delete the module and ensure exception is thrown as expected.
      4. Replace this "throw new exception ..." with the next one and continue until you have gone through all of them in this diff.
      5. Remove the changes you have done from course/lib.php and ensure you can delete the module instance.
      Show
      Create a course module. Edit the function course_delete_module in course/lib.php by copying the first occurrence of "throw new exception ..." in this issues diff and placing it after the declaration of $modulename. Attempt to delete the module and ensure exception is thrown as expected. Replace this "throw new exception ..." with the next one and continue until you have gone through all of them in this diff. Remove the changes you have done from course/lib.php and ensure you can delete the module instance.
    • Affected Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      MDL-37654_master

      Description

      The web services depend on an error code to be returned when an exception is thrown, it is not logical to pass a string that will vary depending on the module being used. Return an error code so it will be the same regardless of module.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            markn Mark Nelson added a comment -

            I also introduced another logic check here, to ensure the function exists before calling it to avoid a PHP error.

            Show
            markn Mark Nelson added a comment - I also introduced another logic check here, to ensure the function exists before calling it to avoid a PHP error.
            Hide
            jerome Jérôme Mouneyrac added a comment - - edited

            fine to me sending to integration. Thanks Mark.

            Show
            jerome Jérôme Mouneyrac added a comment - - edited fine to me sending to integration. Thanks Mark.
            Hide
            damyon Damyon Wiese added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            Cheers!

            Show
            damyon Damyon Wiese added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. Cheers!
            Hide
            damyon Damyon Wiese added a comment -

            Thanks Mark,

            This has been pushed to master only.

            I think you should probably remove this "Ensure they all make sense" from step 4 of the testing instructions as it's a bit vague.

            Show
            damyon Damyon Wiese added a comment - Thanks Mark, This has been pushed to master only. I think you should probably remove this "Ensure they all make sense" from step 4 of the testing instructions as it's a bit vague.
            Hide
            abgreeve Adrian Greeve added a comment -

            Tested on the master integration branch.
            All the appropriate exceptions were thrown.
            Test passed.

            Show
            abgreeve Adrian Greeve added a comment - Tested on the master integration branch. All the appropriate exceptions were thrown. Test passed.
            Hide
            damyon Damyon Wiese added a comment -

            Congratulations this fix has been added to Moodle!

            You may want to dedicate this issue to someone special on this Valentines day.

            Thanks!

            Show
            damyon Damyon Wiese added a comment - Congratulations this fix has been added to Moodle! You may want to dedicate this issue to someone special on this Valentines day. Thanks!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: