#1177 dataforms: Missing <option>s

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

    What steps will reproduce the problem? print(dataforms.new({ { type = "list-single"; name = "abtest"; label = "A or B?"; options = { { label = "A", value = "a", default = true }, { label = "B", value = "b" }, }; }, }):form()); What is the expected output? <x xmlns="jabber:x:data" type="form"> <field label="A or B?" var="abtest" type="list-single"> <option label="A"> <value>a</value> </option> <option label="B"> <value>b</value> </option> <value>a</value> </field> </x> What do you see instead? <x xmlns="jabber:x:data" type="form"> <field label="A or B?" var="abtest" type="list-single"/> </x> What version of the product are you using? On what operating system? 3be8799263f3 (trunk) Please provide any additional information below. Furthermore, :form({abtest = "a"}) yields the following incorrect result (duplicate <value>): <x xmlns="jabber:x:data" type="form"> <field label="A or B?" var="abtest" type="list-single"> <option label="A"> <value>a</value> </option> <value>a</value> <option label="B"> <value>b</value> </option> <value>a</value> </field> </x>

  2. Zash on

    Changes
    • tags Status-Started
    • owner Zash
  3. Zash on

    Fixed in https://hg.prosody.im/trunk/rev/572b6858db03 with followup fixes and tweaks until 05979ae1e38a

    Changes
    • tags Difficulty-Hard Milestone-0.11 Status-Fixed

New comment

Not published. Used for spam prevention and optional update notifications.