Moodle
  1. Moodle
  2. MDL-27165

Show unconfirmed users displays 0 when in fact unconfirmed users exist

    Details

      Description

      As an admin it is possible to browse a list of all Moodle system users:

      Home > Site administration > Users > Accounts > Browse list of users

      One of the filters on this page is 'Confirmed', with a choice of No or Yes.

      When selecting 'No' and then clicking on the [Add filter] button, the screen loads. Even when there are unconfirmed users, the top of the page indicates:

      0 / 2281 Users

      but does also list the users who are unconfirmed.

      So not a serious issue, but annoying,

        Gliffy Diagrams

          Activity

          Hide
          Charles Fulton added a comment -

          Bug confirmed in Moodle 2.0.2+ (Build: 20110406) and I think I know what the problem is. The $usersearchcount variable (admin/user.php:152) is set from a separate call to get_users(). That call uses a different signature than what's defined in lib/datalib.php, and has a hard-coded value of "true" for the third parameter, which is whether or not the user is confirmed. So if you're doing this particular search it's a no-op; it'll never return a number other than 0. I was thinking you could just count() the results from get_user_listing() but that's paginated, isn't it?

          Show
          Charles Fulton added a comment - Bug confirmed in Moodle 2.0.2+ (Build: 20110406) and I think I know what the problem is. The $usersearchcount variable (admin/user.php:152) is set from a separate call to get_users(). That call uses a different signature than what's defined in lib/datalib.php, and has a hard-coded value of "true" for the third parameter, which is whether or not the user is confirmed. So if you're doing this particular search it's a no-op; it'll never return a number other than 0. I was thinking you could just count() the results from get_user_listing() but that's paginated, isn't it?
          Hide
          Helen Foster added a comment -

          Peter, thanks for your report, and Charles, thanks for confirming it.

          Show
          Helen Foster added a comment - Peter, thanks for your report, and Charles, thanks for confirming it.
          Hide
          Petr Skoda added a comment -

          Hello, I will work on this next week after my current fixes get integrated, thanks.

          Show
          Petr Skoda added a comment - Hello, I will work on this next week after my current fixes get integrated, thanks.
          Hide
          Petr Skoda added a comment -

          Thanks a lot for the report.

          Show
          Petr Skoda added a comment - Thanks a lot for the report.
          Hide
          Sam Hemelryk added a comment -

          Thanks Petr - this has been integrated now

          Show
          Sam Hemelryk added a comment - Thanks Petr - this has been integrated now
          Hide
          Ankit Agarwal added a comment -

          Hi,
          This is working great!!
          Passing
          Thanks

          Show
          Ankit Agarwal added a comment - Hi, This is working great!! Passing Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This is now available in the git and cvs repositories.

          Consider the responsibility of your fingerprints engraved there for future generations!

          Thanks for the work, closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - This is now available in the git and cvs repositories. Consider the responsibility of your fingerprints engraved there for future generations! Thanks for the work, closing, ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: