Problem/Motivation

In our use case, we required searching by other fields on the user (specifically real name and email). We added the fields to the view and we were able to perform the search as required.

Unfortunately, the selection fail validation.

This is due to the validation checking to see if the username from the select element and that of the selected user matches - this is not the case with the altered view.

Proposed resolution

Either:

  • Remove the checking of the username.
  • Create a way to change the submitted value to a username.
CommentFileSizeAuthor
#2 selecting_users_from-2778901-2.patch569 bytesjohn cook

Comments

John Cook created an issue. See original summary.

john cook’s picture

StatusFileSize
new569 bytes

We decided against removing the checking as this could lead to passing in random UIDs.

Instead we created a new hook hook_webform_references_user_reference_name_validation_alter(&$name) which could then be implemented in a custom module to change the value from the form into the correct username. This can then be passed through the existing validation procedure.

john cook’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: selecting_users_from-2778901-2.patch, failed testing.

The last submitted patch, 2: selecting_users_from-2778901-2.patch, failed testing.