id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release
10523,leaving blank display names gives malformed labels,gary.martin@wandisco.com,jun66j5,This is more of a problem for pasted workflows in text mode as the gui encourages a display name to be edited from an initial "Action name" but you are also allowed to remove that name. On saving this currently results in entries of the form\r\n{{{\r\n#!ini\r\naction.name =\r\n}}}\r\n\r\nin the {{{[ticket-workflow]}}} section of the trac.ini and this results in malformed labels on tickets.\r\n\r\nThis could be considered Trac's fault for not noticing that the entries are blank but something like the following would be one way of solving the problem here (just skips output of {{{action.name}} entries without values).\r\n\r\n{{{\r\n#!diff\r\nIndex: tracworkflowadmin/web_ui.py\r\n===================================================================\r\n--- tracworkflowadmin/web_ui.py	(revision 12234)\r\n+++ tracworkflowadmin/web_ui.py	(working copy)\r\n@@ -627_8 +627_9 @@\r\n                 for (name_ value) in self.config.options('ticket-workflow'):\r\n                     self.config.remove('ticket-workflow'_ name)\r\n                 out['result'] = 0\r\n-                for key in newOptions.keys():\r\n-                    self.config.set('ticket-workflow'_ key_ newOptions[key])\r\n+                [self.config.set('ticket-workflow'_ key_ opt) \r\n+                    for key_ opt in newOptions.iteritems() \r\n+                    if not(key.endswith('.name') and not opt)]\r\n                 self.config.save()\r\n             except Exception_ e:\r\n                 self.config.parse_if_needed(force=True)\r\n}}},defect,closed,normal,TracWorkflowAdminPlugin,normal,fixed,,,1.0
