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

core_user: Search function fails if no standard identify fields

XMLWordPrintable

      You can configure user identity fields using the 'showuseridentity' config option. These fields are shown in addition to the name on lists of users. Default is email.

      If this is set to empty, or to a list that only includes custom user profile fields and nothing in the standard user table, then there is a bug in the core_user::search function which creates invalid SQL.

      That function also does not support custom user profile fields (there is a TODO) so you can't search for users based on custom fields. While this kind of sucks, it's a separate issue to the bug as there might be performance concerns etc, so I'm going to leave it alone.

      Note: I can't find an easy way to reproduce this in standard Moodle because this function, and the 'core_search/form-search-user-selector' that uses it, seems to only be used in the /search global search form (we have a local plugin here that uses it too, which is why I found the error). And it only appears there if the search engine supports filtering results by user, which solr does but simpledb does not. However it is easy to reproduce by unit test so maybe that is sufficient.

            quen Sam Marshall
            quen Sam Marshall
            Katie Ransom Katie Ransom
            Jun Pataleta Jun Pataleta
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.