I tried creating a userreference field. It works fine and as expected (creating a dropdown list of users) if I create it as a select field with multiple values. If I set it up as a select box and uncheck multiple values, I get an autocomplete field instead.

On a related note, since there is no description field available to explain what you are supposed to do, the auto-complete box is not particularly user-friendly (is it expecting a user id? a username? an email address?), plus, of course, it is not the select box I asked for. Anyway, a description attribute for the field would be handy, but I assume that is not an immediate priority.

Comments

karens’s picture

Title: Problem with select box on userreference and nodereference » Problem with select box on userreference

OK -- found the fix for this one, too.

In userreference.module around line 160, change

if ($field['multiple']) {

to

if ($field['multiple'] or $field['widget']['type'] == 'userreference_select') {

That will create a select box whether or not you have chosen the multiple option.

karens’s picture

Component: Code » userreference.module
Status: Active » Needs review

I'm bumping this since this is still a problem in the latest cvs and it doesn't look like this change has been applied. I didn't create a separate patch file since it is just a one-line change. Without this you do not get a select box unless you also chose the "multiple" option.

around line 160 change
if ($field['multiple']) {

to 
if ($field['multiple'] or $field['widget']['type'] == 'userreference_select') {
jonbob’s picture

Status: Needs review » Fixed

Should be fixed in current CVS after the userreference.module refactoring.

Anonymous’s picture

Status: Fixed » Closed (fixed)