-
Bug
-
Resolution: Fixed
-
Minor
-
2.9
-
MOODLE_29_STABLE
-
MOODLE_29_STABLE, MOODLE_30_STABLE
-
MDL-50357_master -
- Run PHPUnit tests.
-
3.1 Stable Sprint 2
group/lib.php
I used this function as an interview question to review some bad code.
The bug in this code is not closing the recordset - but there are some other things that are not good here:
- (repeated) DB queries in a loop
- no error checking
- mixes display logic and business logic
- does not clear group caches
- it makes baby kittens sad