Default value for project filter is not set when using select
claudiu.cristea - October 15, 2009 - 13:58
| Project: | Localization server |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | claudiu.cristea |
| Status: | closed |
Description
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
<?php
'#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.
| Attachment | Size |
|---|---|
| l10n_server_project_filter-D6.patch | 1.54 KB |

#1
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.
#2
#3
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:
#4
The autocomplete will only ever get us the title, so using the same data in the select would be useful.
#5
Voila! Replaced the URI with Title in option's value attribute.
#6
Thanks, committed this one.
#7
Automatically closed -- issue fixed for 2 weeks with no activity.