wrong element name in data forms <values /> -> <value />
There is a problem in the data forms (JEP-0004) implementation in Gajim 0.9 and 0.9.1
When sending this to a JUD component :
<iq to="users.jabberfr.org" type="get" id="30" from="tiennou@jabber.fr/France/Paris/Maison/Gajim"> <query xmlns="jabber:iq:register" /> </iq>
And receiving this :
<iq from='users.jabberfr.org' type='result' id='30' to='tiennou@jabber.fr/France/Paris/Maison/Gajim'> <query xmlns='jabber:iq:register'> <instructions>Use the enclosed form to register. You client might not support x:data. Consider using the web interface at http://annuaire.jabberfr.org/\ <x type='form' xmlns='jabber:x:data'> <title>Jabber User Directory Registration</title> <instructions>Fill in the form to register in the Jabber User Directory</instructions> <field type='text-single' var='first' label='Firstname'/> <field type='text-single' var='last' label='Lastname'/> <field type='text-single' var='nick' label='Nickname'/> <field type='text-single' var='email' label='Email address'/> <field type='text-single' var='website' label='Website'/> <field type='text-single' var='location' label='Location'/> <field type='text-single' var='birthdate' label='Birthdate (DD/MM/YYYY)'/> <field type='text-single' var='comment' label='Comments'/> <field type='list-single' var='gender' label='Gender (M/F)'> <option label='Male'> <value>M</value> </option> <option label='Female'> <value>F</value> </option> </field> </x> </query> </iq>
I get a traceback from Gajim :
Traceback (most recent call last):
File "gajim.py", line 1254, in process_connections
gajim.mutex_events_for_ui.lock(self.exec_event, account)
File "/usr/lib/python2.4/mutex.py", line 41, in lock
function(argument)
File "gajim.py", line 1239, in exec_event
self.handlersev[0]
File "gajim.py", line 608, in handle_event_register_agent_info
array[2])
File "/usr/local/share/gajim/src/config.py", line 1918, in init
DataFormWindow.init(self, account, infos)
File "/usr/local/share/gajim/src/config.py", line 1717, in init
self.fill_table()
File "/usr/local/share/gajim/src/config.py", line 1809, in fill_table
if self.config[i]['options'][j]['values'][0] ==
KeyError: 'values'
Indeed, Gajim expects to find a <values /> element in a <list-single /> element though there is only a <value /> element defined in data forms. A quick workaround would be to replace "values" with "value" in the config.py file. However, even if data forms only define a <value /> element, a <values /> element (bad data forms implementation for example) should be ignored and not generate a traceback.
Sorry to find that after version 0.9.1 is out... :-(