#0828 Traceback when viewing an added custom field
An error occured when I tried to...
--------------------------------------------------
Error type: NameError
Error value: global name 'sorted' is not defined
<p>Traceback (innermost last):
<ul>
<li> Module ZPublisher.Publish, line 114, in publish</li>
<li> Module ZPublisher.mapply, line 88, in mapply</li>
<li> Module ZPublisher.Publish, line 40, in call_object</li>
<li> Module Shared.DC.Scripts.Bindings, line 311, in __call__</li>
<li> Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec</li>
<li> Module Products.PageTemplates.PageTemplateFile, line 110, in _exec</li>
<li> Module Products.PageTemplates.PageTemplate, line 104, in pt_render<br />
<b><PageTemplateFile at /ITP-IT/custom_fields/efd/manage_field></b></li>
<li> Module TAL.TALInterpreter, line 206, in __call__</li>
<li> Module TAL.TALInterpreter, line 250, in interpret</li>
<li> Module TAL.TALInterpreter, line 501, in do_insertText_tal</li>
<li> Module Products.PageTemplates.TALES, line 227, in evaluateText</li>
<li> Module Products.PageTemplates.TALES, line 221, in evaluate<br />
<b>URL: manage_field</b><br />
<b>Line 128, Column 0</b><br />
<b>Expression: standard:'here/preview_render'</b><br />
<b>Names:</b><pre>{'container': <CustomField at /ITP-IT/custom_fields/efd>,
'context': <CustomField at /ITP-IT/custom_fields/efd>,
'default': <Products.PageTemplates.TALES.Default instance at 0x2b6343f96c20>,
'here': <CustomField at /ITP-IT/custom_fields/efd>,
'loop': <Products.PageTemplates.TALES.SafeMapping object at 0x2daa200>,
'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x2b6343f9d5f0>,
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.TALES.SafeMapping object at 0x2daa200>,
'request': <HTTPRequest, URL=http://adminsrv01.flowtraders.nl:8080/ITP-...ields/efd/manage_field>,
'root': <Application at >,
'template': <PageTemplateFile at /ITP-IT/custom_fields/efd/manage_field>,
'traverse_subpath': [],
'user': magnus}</pre></li>
<li> Module Products.PageTemplates.Expressions, line 185, in __call__</li>
<li> Module Products.PageTemplates.Expressions, line 180, in _eval</li>
<li> Module Products.PageTemplates.Expressions, line 85, in render</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 694, in preview_render</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 411, in render</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 631, in render_tag</li>
</ul>NameError: global name 'sorted' is not defined
</p>
1 year and 4 months and 2 weeks old
Thanks for spotting that one. It happened because you're running an old version of python (python 2.3 or older) which doesn't have the builtin function sorted. I've patched that now so you have to get the latest svn version. There might be other issues too that I haven't tested for in python2.3. Keep em coming.
New traceback:
--------------------------------------------------
Error type: TypeError
Error value: sort() takes no keyword arguments
<p>Traceback (innermost last):
<ul>
<li> Module ZPublisher.Publish, line 114, in publish</li>
<li> Module ZPublisher.mapply, line 88, in mapply</li>
<li> Module ZPublisher.Publish, line 40, in call_object</li>
<li> Module Shared.DC.Scripts.Bindings, line 311, in __call__</li>
<li> Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec</li>
<li> Module Products.PageTemplates.PageTemplateFile, line 110, in _exec</li>
<li> Module Products.PageTemplates.PageTemplate, line 104, in pt_render<br />
<b><PageTemplateFile at /ITP-IT/custom_fields/efd/manage_field></b></li>
<li> Module TAL.TALInterpreter, line 206, in __call__</li>
<li> Module TAL.TALInterpreter, line 250, in interpret</li>
<li> Module TAL.TALInterpreter, line 501, in do_insertText_tal</li>
<li> Module Products.PageTemplates.TALES, line 227, in evaluateText</li>
<li> Module Products.PageTemplates.TALES, line 221, in evaluate<br />
<b>URL: manage_field</b><br />
<b>Line 128, Column 0</b><br />
<b>Expression: standard:'here/preview_render'</b><br />
<b>Names:</b><pre>{'container': <CustomField at /ITP-IT/custom_fields/efd>,
'context': <CustomField at /ITP-IT/custom_fields/efd>,
'default': <Products.PageTemplates.TALES.Default instance at 0x2ab406a7ac20>,
'here': <CustomField at /ITP-IT/custom_fields/efd>,
'loop': <Products.PageTemplates.TALES.SafeMapping object at 0x2ab40810ccb0>,
'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x2ab406a815f0>,
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.TALES.SafeMapping object at 0x2ab40810ccb0>,
'request': <HTTPRequest, URL=http://adminsrv01.flowtraders.nl:8080/ITP-...ields/efd/manage_field>,
'root': <Application at >,
'template': <PageTemplateFile at /ITP-IT/custom_fields/efd/manage_field>,
'traverse_subpath': [],
'user': magnus}</pre></li>
<li> Module Products.PageTemplates.Expressions, line 185, in __call__</li>
<li> Module Products.PageTemplates.Expressions, line 180, in _eval</li>
<li> Module Products.PageTemplates.Expressions, line 85, in render</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 702, in preview_render</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 419, in render</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 639, in render_tag</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 133, in sorted</li>
</ul>TypeError: sort() takes no keyword arguments
Just to confirm what I want to do. I want to add a Date field on issues where an estimated completion date can be entered. It's not required to do anything other than be recorded. :) (We want to use it also for planning, and some issues tend to be quite far in the future.)
Zope Version (Zope 2.8.9.1-final, python 2.3.6, linux2)
Python Version 2.3.6 (#0001, Apr 17 2009, 10:14:03) [GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)]
I'm using the default gentoo builds.
Pull the SVN again. Not sure if I've done the right thing this time. I can't test on python2.3
Ok, new error. :)
--------------------------------------------------
Error type: TypeError
Error value: sort expected at most 1 arguments, got 3
<p>Traceback (innermost last):
<ul>
<li> Module ZPublisher.Publish, line 114, in publish</li>
<li> Module ZPublisher.mapply, line 88, in mapply</li>
<li> Module ZPublisher.Publish, line 40, in call_object</li>
<li> Module Shared.DC.Scripts.Bindings, line 311, in __call__</li>
<li> Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec</li>
<li> Module Products.PageTemplates.PageTemplateFile, line 110, in _exec</li>
<li> Module Products.PageTemplates.PageTemplate, line 104, in pt_render<br />
<b><PageTemplateFile at /ITP-IT/custom_fields/efd/manage_field></b></li>
<li> Module TAL.TALInterpreter, line 206, in __call__</li>
<li> Module TAL.TALInterpreter, line 250, in interpret</li>
<li> Module TAL.TALInterpreter, line 501, in do_insertText_tal</li>
<li> Module Products.PageTemplates.TALES, line 227, in evaluateText</li>
<li> Module Products.PageTemplates.TALES, line 221, in evaluate<br />
<b>URL: manage_field</b><br />
<b>Line 128, Column 0</b><br />
<b>Expression: standard:'here/preview_render'</b><br />
<b>Names:</b><pre>{'container': <CustomField at /ITP-IT/custom_fields/efd>,
'context': <CustomField at /ITP-IT/custom_fields/efd>,
'default': <Products.PageTemplates.TALES.Default instance at 0x2abc95e29c20>,
'here': <CustomField at /ITP-IT/custom_fields/efd>,
'loop': <Products.PageTemplates.TALES.SafeMapping object at 0x2abc9740eb48>,
'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x2abc95e305f0>,
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.TALES.SafeMapping object at 0x2abc9740eb48>,
'request': <HTTPRequest, URL=http://adminsrv01.flowtraders.nl:8080/ITP-...ields/efd/manage_field>,
'root': <Application at >,
'template': <PageTemplateFile at /ITP-IT/custom_fields/efd/manage_field>,
'traverse_subpath': [],
'user': magnus}</pre></li>
<li> Module Products.PageTemplates.Expressions, line 185, in __call__</li>
<li> Module Products.PageTemplates.Expressions, line 180, in _eval</li>
<li> Module Products.PageTemplates.Expressions, line 85, in render</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 702, in preview_render</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 419, in render</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 639, in render_tag</li>
<li> Module Products.IssueTrackerProduct.CustomField, line 133, in sorted</li>
</ul>TypeError: sort expected at most 1 arguments, got 3
</p>
Change line 133 in CustomField.py to copy.sort(), works now.
I know but it's not a very elegant solution. However, running python 2.3 isn't very elegant either :)
I've changed it to that simple sort now. Please try again.