Moodle

potato WS code review

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Web Services
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

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

Activity

Hide
Petr Škoda (skodak) added a comment -

:-D

Show
Petr Škoda (skodak) added a comment - :-D

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: