-
Sub-task
-
Resolution: Fixed
-
Minor
-
2.0
-
None
-
MOODLE_20_STABLE
-
MOODLE_20_STABLE
Quick review of code at http://potato.lsi.upc.edu/projects/moodlewebservices/browser/moodle
1/ do not include all libraries at the top of externallib, always require in each method separately - the externallib libs are included during each upgrade and the libs take up a lot of memory even when they are not used at all
2/ new DML code does not return $success, instead it throws exceptions; for example $if ($DB->insert_record()) is useless now
3/ use delegated transactions - see group/externallib.php
4/ do not use throw new moodle_exception ('noexistingrole'); instead use the new MUST_EXIST parameter in get_record() and similar
5/ do not create new localised error strings when not necessary
6/ create_course_categories - check capability in parent category, not just system context
going to add more here when these get fixed