Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Workflow macro: use 12 hexdigits for graph ids instead of 8.

On Linux x86_64, `id()` returns a large integer which is represented by more than 8 hex digits.

Also, use `"%0nx"` instead of `"%.nx`, the latter happens to work but is normally meant to be used for floating point values. (''The precision is not allowed for integer values'', [http://docs.python.org/library/string.html#formatstrings 7.1.3]).


git-svn-id: http://svn.edgewall.org/repos/trac/trunk@11033 af82e41b-90c4-0310-8c96-b1721e28e2e2
  • Loading branch information...
commit 81e4866645d05623b2001798caa0c64787ba94c9 1 parent b44d860
cboos authored
2  trac/htdocs/js/workflow_graph.js
View
@@ -208,7 +208,7 @@
$(document).ready(function() {
$('.trac-workflow-graph').each(function (index) {
- var data = window['graph_' + this.id.slice(-8)];
+ var data = window['graph_' + this.id.slice(-12)];
var width = data.width, height = data.height;
var nodes = [], actions = [], edges = [];
for (var i = 0; i < data.nodes.length; ++i)
2  trac/ticket/default_workflow.py
View
@@ -485,7 +485,7 @@ def expand_macro(self, formatter, name, text, args):
graph = {'nodes': states, 'actions': action_names, 'edges': edges,
'width': args.get('width', 800),
'height': args.get('height', 600)}
- graph_id = '%.8x' % id(graph)
+ graph_id = '%012x' % id(graph)
req = formatter.req
add_script(req, 'common/js/excanvas.js', ie_if='IE')
add_script(req, 'common/js/workflow_graph.js')
Please sign in to comment.
Something went wrong with that request. Please try again.