The #default_value is not correctly set on filter forms when select is used instead of autocomplete.

This is happen because in l10n_community_filter_form() the value is set

    '#default_value' => isset($filters['project']) ? $filters['project']->title : '',

but when select is used the value passed should be $filters['project']->uri not $filters['project']->title.

This patch fixes this bug.

Comments

gábor hojtsy’s picture

We tried to use the same data handling, so the select should ideally use the title too, which would fix this problem in a different way to make it consistent.

gábor hojtsy’s picture

Status: Needs review » Needs work
claudiu.cristea’s picture

To me, the URI is something more consistent. I'm not sure that the project title is unique but the URI surely is.

We can:

  • Use the URI. Use "node like" approach... On node autoselects we use: "Title [nid:$nid]". Maybe we want to use for projects autocomplete "Title [URI]" and use the URI.
  • Use Title. Store the Title in select option's value.
gábor hojtsy’s picture

The autocomplete will only ever get us the title, so using the same data in the select would be useful.

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new803 bytes

Voila! Replaced the URI with Title in option's value attribute.

gábor hojtsy’s picture

Status: Needs review » Fixed

Thanks, committed this one.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.