Moodle
  1. Moodle
  2. MDL-29817

Passing attributes to advcheckbox form object triggers "undefined index" notice.

    Details

    • Database:
      Any
    • Workaround:
      Hide

      Put a bogus "group" key into the attributes array, but may have side effects.

      Show
      Put a bogus "group" key into the attributes array, but may have side effects.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_21_STABLE
    • Rank:
      19343

      Description

      On or about line 47 of /lib/form/advcheckbox.php is the line:

      <code>
      if (!is_null($attributes['group'])) {
      <code>

      If the attributes array doesn't contain the 'group' key, an undefined index notice will be triggered. The following line should make the notice go away:

      <code>
      if (!is_null($attributes) && array_key_exists('group', $attributes)) {
      <code>

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting that issue and providing a fix.

          It looks like you won!

          Show
          Michael de Raadt added a comment - Thanks for reporting that issue and providing a fix. It looks like you won!
          Hide
          Rajesh Taneja added a comment -

          Hello. I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.

          For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

          If you have any information about this issue or a possible fix please post it here

          Show
          Rajesh Taneja added a comment - Hello. I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment If you have any information about this issue or a possible fix please post it here

            People

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

              Dates

              • Created:
                Updated: