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

Incorrect return value of update_instance()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.9.10, 2.0
    • 1.9.8
    • Assignment (2.2)
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE, MOODLE_20_STABLE

      The function "update_instance()" in class assignment_base, file mod/assignment/lib.php, is documented as follows:

        /**
           * Updates a new assignment activity
           *
           * Given an object containing all the necessary data,
           * (defined by the form in mod.html) this function
           * will update the assignment instance and return the id number
           * The due date is updated in the calendar
           * This is common to all assignment types.
           *
           * @param $assignment object The data from the form on mod.html
           * @return int The assignment id
           */

      However, in the actual code, it does not return an assignment id. Rather, it always returns "true".

      This doesn't seem to cause malfunction, but it caused me some headache when developing a custom assignment type...

            skodak Petr Skoda
            bostelm Henning Bostelmann
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.