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

Advanced User Filter Problems

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9
    • 1.9
    • Administration
    • None
    • Any
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

    Description

      There are 3 advanced user filter options (found within "Site Administration > Users > Accounts > Bulk user actions" that do not work correctly. namely System role, Course role and category. When the required filter is selected, a different value is actually populated as the filter. This is due to the use of the array_merge to prepend the "any" option which messes up the IDs for the select value. Below is my solution to the issue:

      ===================================================================
      RCS file: /cvsroot/moodle/moodle/user/filters/globalrole.php,v
      retrieving revision 1.1.2.2
      diff -u -r1.1.2.2 globalrole.php
      — globalrole.php 11 Dec 2007 13:01:14 -0000 1.1.2.2
      +++ globalrole.php 31 Jan 2008 05:24:16 -0000
      @@ -23,7 +23,7 @@
      */
      function get_roles()

      { $context = get_context_instance(CONTEXT_SYSTEM); - $roles = array_merge(array(0=> get_string('anyrole','filters')), get_assignable_roles($context)); + $roles = array(0=> get_string('anyrole','filters')) + get_assignable_roles($context); return $roles; }

      ===================================================================
      RCS file: /cvsroot/moodle/moodle/user/filters/courserole.php,v
      retrieving revision 1.1.2.2
      diff -u -r1.1.2.2 courserole.php
      — courserole.php 11 Dec 2007 13:01:13 -0000 1.1.2.2
      +++ courserole.php 31 Jan 2008 03:54:01 -0000
      @@ -22,7 +22,7 @@
      */
      function get_roles() { $context = get_context_instance(CONTEXT_SYSTEM);- $roles = array_merge(array(0=> get_string('anyrole','filters')), get_assignable_roles($context));+ $roles = array(0=> get_string('anyrole','filters')) + get_assignable_roles($context); return $roles; }

      @@ -34,7 +34,7 @@
      $displaylist = array();
      $parentlist = array();
      make_categories_list($displaylist, $parentlist);

      • return array_merge(array(0=> get_string('anycategory', 'filters')), $displaylist);
        + return array(0=> get_string('anycategory', 'filters')) + $displaylist;
        }

      /**

      Attachments

        Activity

          People

            poltawski Dan Poltawski
            rochford Dennis Rochford
            Séverin Terrier Séverin Terrier
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              3/Mar/08