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

allow_assign function does not return any values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.2
    • Component/s: Accessibility
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      In accesslib.php, allow_assign()'s documentation states that it will return an int if successful or a bool false if not successful. But the function doesn't return anything.

      Pasting the method

      /**
       * Creates a record in the role_allow_assign table
       *
       * @param int $sroleid source roleid
       * @param int $troleid target roleid
       * @return int id or false
       */
      function allow_assign($fromroleid, $targetroleid) {
          global $DB;
       
          $record = new stdClass();
          $record->roleid      = $fromroleid;
          $record->allowassign = $targetroleid;
          $DB->insert_record('role_allow_assign', $record);
      }

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                21/Feb/11