#982 util.dataforms list-multi values go into options

Reporter Zash
Owner MattJ
Created
Updated
Stars ★ (1)  
Tags
  • Milestone-0.10
  • Status-Fixed
  • Type-Defect
  • Priority-Medium
  1. Zash on

    What steps will reproduce the problem? print(require"util.dataforms".new({{name="test",type="list-multi"}}):form({test={"foo","bar"}})) What is the expected output? <x xmlns="jabber:x:data" type="form"> <field type="list-multi" var="test"> <value>foo</value> <value>bar</value> </field> </x> What do you see instead? <x xmlns="jabber:x:data" type="form"> <field type="list-multi" var="test"> <option> <value>foo</value> </option> <option> <value>bar</value> </option> </field> </x> What version of the product are you using? On what operating system? 8ea0484871e8 0.10

  2. Zash on

    https://hg.prosody.im/0.10/rev/d70d4c1ac17a print(require"util.dataforms".new({{name="test",type="list-multi"}}):form({test={"foo","bar"}}, "result")) <x xmlns="jabber:x:data" type="result"> <field type="list-multi" var="test"> <value>foo</value> <value>bar</value> </field> </x> Note the type argument being "result".

    Changes
    • tags Milestone-0.10 Status-Fixed
    • owner MattJ

New comment