Moodle
  1. Moodle
  2. MDL-25709

allow_assign function does not return any values

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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);
      }

        Gliffy Diagrams

          Activity

          Hide
          Dan Poltawski added a comment -

          PULL-57 created for fixes to be merged upstream

          Show
          Dan Poltawski added a comment - PULL-57 created for fixes to be merged upstream
          Hide
          Dan Poltawski added a comment -

          Reopening as review said there was no need to return ids

          Show
          Dan Poltawski added a comment - Reopening as review said there was no need to return ids
          Hide
          Dan Poltawski added a comment -

          Submitted a new pull request PULL-68 with the documentation fixed instead of changing behvious

          Show
          Dan Poltawski added a comment - Submitted a new pull request PULL-68 with the documentation fixed instead of changing behvious
          Hide
          Helen Foster added a comment -

          Thanks Akin and Dan.

          Show
          Helen Foster added a comment - Thanks Akin and Dan.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: