/
Edit Option Empty Value Always Displayed

Edit Option Empty Value Always Displayed

Imported From: http://groups.google.com/group/in-portal-bugs/browse_thread/thread/d0946d44e843c2e0#

Hi,

when using inp_edit_options to display a dropdown, we have, among other parameters, has_empty and empty_value.

1. when using has_empty=1, it doesn't replace default empty value

2. has_empty is widely used with "has_empty=1" in theme, but without any empty_value, it add nothing

3. a bug in db_tag_processor adds always and empty value in select field type

Examples:
- without has_empty parameter specified, it uses default value from inp_edit_option, which is 0, and <select> have an empty value anyway (bug 3)

- with has_empty parameter specified, like in many tpl, <select> have an empty value, and nothing added (bug 2 + 3)

- with has_empty set to 1, and empty_value specified, <select> have an empty value, plus another blank value with value= empty_value parameter (bug 1 + 2 + 3)

In addition, has_empty have only 0/1 value, and empty_value display only when has_empty=1. Knowing that all places in theme where has_empty="1" don't use empty_value, I don't see any point to keep this parameter. I'd suggest to check for empty_value parameter, and display it if present, and for example transform 0 to a real empty value.

p