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

Incorrect return value of update_instance()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.8
    • Fix Version/s: 1.9.10, 2.0
    • Component/s: Assignment (2.2)
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      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...

        Attachments

          Activity

            People

            • Assignee:
              skodak Petr Skoda
              Reporter:
              bostelm Henning Bostelmann
              Tester:
              Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Oct/10