Skip to content

Search built in to the "user" type field is broken #28

@ChemiKyle

Description

@ChemiKyle

Complete user search is broken, and must have been for some time for forms with fields of type user.

To recreate:

  • Use REDCap 9.3.5 or greater (possibly earlier)
  • Enable the protocols_advanced module
  • Enable the module on any project
  • Navigate to the "Protocols" page
  • Attempt to select a PI
  • Observe that the list never populates

The root of the issue is here:

ajax: {
url: app_path_webroot + 'UserRights/search_user.php',
dataType: 'json',
cache: true,
delay: 250,
data: function (params) {
params.searchEmail = true;
return params;
},

At some point, the UserRights/search_user.php endpoint began requiring a term in the GET data and it cannot be set to empty string.


A good candidate to replace the call to this page may be the Project->getUsers() function, although this requires a Project object be available and is scoped to the project from which it is called.
Better would be to find a way to get an empty string or wildcard in to the term arg:

data: function (params) { 
         params.searchEmail = true; 
         params.term = wildcardChar;
         return params; 
     }, 

Also consider hijacking the user-listcall made by the ExternalModules config menu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions