MantisBT: master b8dcb52a

Author Committer Branch Timestamp Parent
cproensa dregad master 2015-10-23 12:19 master 738272f2
Affected Issues  0019978: Values not preserved on filter page
Changeset

print_enum_string_option_list() accepts array of values

This function was originally defined to accept an integer as current
value for the option list, so it gets defaulted. However, some places
(e.g. filter fields) were calling the function with this parameter set
as an array of one integer (or more, for multiselection option lists).

Changed parameter to accept array, since the check_selected() function
already accepts an array of values to check.

Adding a check for the case $p_val is a single value to cast it to an
int, because check_select() should be called in strict mode for enum
keys anyways, and some callers may still pass a number as string.

In the case of "array of int", the caller must ensure values are proper
int type.

Fixes 0019978

Reworded original commit message.

Signed-off-by: Damien Regad dregad@mantisbt.org

mod - core/print_api.php Diff File