how to access vlaues in custom field, multi-selection list?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how to access vlaues in custom field, multi-selection list?

TrishB
I had this working in bugzilla 3.2.2, now I want to make it work in 3.4.1.

On the search page, I was able to have a list box which showed my custom field values. The searcher could use these values in his search.

The applicable chunk of code which populated the listbox was:

        [% FOREACH name=sel.field_obj.legal_values %]
          <option value="[% name FILTER html %]"> 
             [% "selected" IF lsearch(default.${sel.field_obj.name}, name) != -1 %]
             [% name FILTER html %]
          </option> 

However, I'm missing part of the puzzle, because this displays
            Bugzilla::Field::Choice::cf_fw_keyword=HASH(0x....)
for each option in the listbox, instead of the values (my field name is cf_fw_keyword).

Can anyone offer any help?
Reply | Threaded
Open this post in threaded view
|

Re: how to access vlaues in custom field, multi-selection list?

Max Kanat-Alexander
TrishB wrote:
>         [% FOREACH name=sel.field_obj.legal_values %]

  "name" there is now an object. If you want to see its value, do
"name.object". Of course, you'll probably want to rename the variable
from "name", since that it's quite right anymore.

        -Max
--
http://www.everythingsolved.com/
Competent, Friendly Bugzilla and Perl Services. Everything Else, too.
_______________________________________________
support-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put [hidden email] in the To: field when you reply.
Reply | Threaded
Open this post in threaded view
|

Re: how to access vlaues in custom field, multi-selection list?

Max Kanat-Alexander
Max Kanat-Alexander wrote:
> TrishB wrote:
>>         [% FOREACH name=sel.field_obj.legal_values %]
>
>      "name" there is now an object. If you want to see its value, do
> "name.object".

        Oops. I meant "name.value".

        -Max
--
http://www.everythingsolved.com/
Competent, Friendly Bugzilla and Perl Services. Everything Else, too.
_______________________________________________
support-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put [hidden email] in the To: field when you reply.
Reply | Threaded
Open this post in threaded view
|

Re: how to access values in custom field, multi-selection list?

TrishB
In reply to this post by TrishB
Thanks, that worked.