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

Group update shouldn't require group name

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.8, BACKEND
    • Component/s: Groups
    • Labels:

      Description

      Calling groups_update_group() (in group/lib.php) by passing a $data object that doesn't contain a 'name' property results in an 'undefined property' notice.

      It should be possible to call the function without $data->name (e.g. if just the group description is being updated).

      TO REPRODUCE THE ERROR
      1. Comment the line 154 of the groups/tests/lib_test.php

        $data->name = 'Backend team';

      2. Run unit tests on groups/tests/lib_test.php.
      3. The unit test will fail and give this message:

        There was 1 error:
         
        1) core_group_lib_testcase::test_group_updated_event
        Undefined property: stdClass::$name
        

        Attachments

          Activity

            People

            Assignee:
            tonybutler Tony Butler
            Reporter:
            tonybutler Tony Butler
            Peer reviewer:
            Simey Lameze
            Integrator:
            Damyon Wiese
            Tester:
            John Okely
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/Nov/14