Commit 4df03d3c authored by Tres Seaver's avatar Tres Seaver

Fix LP #707927:

- Hardened XML import parsing against missing boolean attributes.
 
- Ensured that emitted XML export has a valid encoding, even when passed
  'None'.
parent b1cf1994
......@@ -4,7 +4,13 @@ Products.DCWorkflow Changelog
2.3.0-alpha (unreleased)
------------------------
- Fixed Chameleon compatibility in `state_groups.pt`.
- Hardened XML import parsing against missing boolean attributes.
(https://bugs.launchpad.net/zope-cmf/+bug/707927)
- Ensured that emitted XML export has a valid encoding, even when passed
'None'. (https://bugs.launchpad.net/zope-cmf/+bug/707927)
- Fixed Chameleon compatibility in 'state_groups.pt'.
- Workflow states cannot be renamed through the ZMI.
(https://bugs.launchpad.net/zope-cmf/+bug/625722)
......
......@@ -678,7 +678,7 @@ def _extractStateNodes( root, encoding=None ):
for p_map in s_node.getElementsByTagName( 'permission-map' ):
name = _getNodeAttribute( p_map, 'name', encoding )
acquired = _getNodeAttributeBoolean( p_map, 'acquired' )
acquired = _queryNodeAttributeBoolean( p_map, 'acquired', False )
roles = [ _coalesceTextNodeChildren( x, encoding )
for x in p_map.getElementsByTagName(
......@@ -760,14 +760,17 @@ def _extractVariableNodes( root, encoding=None ):
info = { 'variable_id' : _getNodeAttribute( v_node, 'variable_id'
, encoding )
, 'description' : _extractDescriptionNode( v_node, encoding )
, 'for_catalog' : _getNodeAttributeBoolean( v_node
, 'for_catalog' : _queryNodeAttributeBoolean( v_node
, 'for_catalog'
, False
)
, 'for_status' : _getNodeAttributeBoolean( v_node
, 'for_status' : _queryNodeAttributeBoolean( v_node
, 'for_status'
, False
)
, 'update_always' : _getNodeAttributeBoolean( v_node
, 'update_always' : _queryNodeAttributeBoolean( v_node
, 'update_always'
, False
)
, 'default' : _extractDefaultNode( v_node, encoding )
, 'guard' : _extractGuardNode( v_node, encoding )
......
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<dc-workflow
xmlns:tal="http://xml.zope.org/namespaces/tal"
workflow_id="dcworkflow"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment