[Silva-general] Silva 2.2 toc and citation Code Source testing
Wim Boucquaert
wim at infrae.com
Thu May 13 17:34:44 CEST 2010
Hi all,
I've been testing the toc and citation code source in Silva 2.2 and
found problems with the citation CS.
Toc CS
======
FireFox
-------
OK
Internet Explorer 8
-------------------
OK
Citation CS
===========
FireFox
~~~~~~~
- Without rich text (bold, underline, ...) everything works fine.
- With rich text everything works fine.
- With links you get errors:
Let's add a citation cs coming from the root:
Well well this give us the following traceback:
2010-05-12 14:38:08 ERROR Zope.SiteErrorLog 1273667888.240.312760897125
http://localhost:8080/test/cs_citation/validate_form_to_request
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module Products.PDBDebugMode.pdbzope.runcall, line 60, in pdb_runcall
Module ZPublisher.Publish, line 42, in call_object
Module Products.SilvaExternalSources.ExternalSource, line 231, in
validate_form_to_request
Module Products.Formulator.Form, line 384, in validate_all
Module Products.Formulator.Field, line 381, in validate
Module Products.Formulator.Field, line 370, in _validate_helper
Module Products.Silva.kupupopupfield, line 40, in validate
Module Products.SilvaDocument.transform.Transformer, line 51, in
to_source
Module Products.SilvaDocument.transform.base, line 196, in convert
Module Products.SilvaDocument.transform.kupu.htmlformat, line 886, in
convert
Module Products.SilvaDocument.transform.kupu.htmlformat, line 194, in
fix_structure
Module Products.SilvaDocument.transform.kupu.htmlformat, line 144, in
get_textbuf
Module Products.SilvaDocument.transform.base, line 196, in convert
Module Products.SilvaDocument.transform.kupu.silvaformat, line 230,
in convert
Module Products.SilvaDocument.transform.base, line 196, in convert
Module Products.SilvaDocument.transform.kupu.silvaformat, line 217,
in convert
Module Products.SilvaDocument.transform.base, line 196, in convert
Module Products.SilvaDocument.transform.kupu.silvaformat, line 254,
in convert
AttributeError: Context instance has no attribute 'model'
>
/home/wim/Buildouts/Silva-2.2-new/eggs/Products.SilvaDocument-2.2-py2.4.egg/Products/SilvaDocument/transform/kupu/silvaformat.py(254)convert()
-> pad = pathadapter.getPathAdapter(context.model.REQUEST)
Found the pattern to reproduce this error. It only happens on initial
setup and adding a link to the content of one of the fields like 'citation'.
If you add a link to one of the cs fields after the cs has been added,
then no error occurs.
Internet Explorer 8
~~~~~~~~~~~~~~~~~~~
When trying to edit the citation field you get:
Module zope.tales.tales, line 696, in evaluate
- URL: file:Silva/kupu/kupupopup.html
- Line 498, Column 10
- Expression: <PythonExpr sequence.sort(sources, (('title',
'nocase', 'asc'),))>
- Names:
{'container': <Silva Root instance clean-toc>,
'context': <Silva Root instance clean-toc>,
'default': <object object at 0x7f3e70daa200>,
'here': <Silva Root instance clean-toc>,
'loop': {},
'nothing': None,
'options': {'args': (<Products.Five.metaclass.SimpleViewClass
from
/home/wim/Buildouts/Silva-2.2-new/src/Products.Silva/Products/Silva/browser/kupu_popup_window.pt
object at 0x702ab10>,)},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object
at 0x702d2d8>,
'request': <HTTPRequest,
URL=http://192.168.2.111:8080/clean-toc/@@kupu_popup_window>,
'root': <Application at >,
'template': <ImplicitAcquirerWrapper object at 0x66f4710>,
'traverse_subpath': [],
'user': <User 'admin'>,
'view': <Products.Five.metaclass.SimpleViewClass from
/home/wim/Buildouts/Silva-2.2-new/src/Products.Silva/Products/Silva/browser/kupu_popup_window.pt
object at 0x702ab10>,
'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper
object at 0x66f46d0>}
Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
- __traceback_info__: sequence.sort(sources, (('title', 'nocase',
'asc'),))
Module PythonExpr, line 1, in <expression>
Module zope.sequencesort.ssort, line 82, in sort
TypeError: iteration over non-sequence
>
/home/wim/Buildouts/Silva-2.2-new/parts/zope2/lib/python/zope/sequencesort/ssort.py(82)sort()
-> for client in sequence:
Rendering CS field
------------------
When rendering an existing CS field you get:
ERROR Zope.SiteErrorLog 1273748340.770.970342596662
http://192.168.2.111:8080/testothercs/index/@@render_extsource
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module Products.PDBDebugMode.pdbzope.runcall, line 60, in pdb_runcall
Module ZPublisher.Publish, line 42, in call_object
Module Products.Silva.browser.kupu, line 16, in __call__
Module Products.SilvaExternalSources.CodeSource, line 109, in to_html
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.PageTemplates.ZopePageTemplate, line 330, in _exec
Module Products.PageTemplates.ZopePageTemplate, line 427, in pt_render
Module Products.PTProfiler.ProfilerPatch, line 83, in __patched_render__
Module Products.PageTemplates.PageTemplate, line 98, in pt_render
Module zope.pagetemplate.pagetemplate, line 115, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 534, in do_optTag_tal
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 754, in do_insertStructure_tal
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 28:
ordinal not in range(128)
>
/home/wim/Buildouts/Silva-2.2-new/parts/zope2/lib/python/zope/tal/talinterpreter.py(754)do_insertStructure_tal()
-> text = unicode(structure)
Adding link
-----------
When adding a link to a inital cs field you get:
2010-05-13 17:24:05 ERROR Zope.SiteErrorLog 1273764245.670.307550558752
http://192.168.2.111:8080/clean-toc/cs_citation/validate_form_to_request
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module Products.PDBDebugMode.pdbzope.runcall, line 60, in pdb_runcall
Module ZPublisher.Publish, line 42, in call_object
Module Products.SilvaExternalSources.ExternalSource, line 231, in
validate_form_to_request
Module Products.Formulator.Form, line 384, in validate_all
Module Products.Formulator.Field, line 381, in validate
Module Products.Formulator.Field, line 370, in _validate_helper
Module Products.Silva.kupupopupfield, line 40, in validate
Module Products.SilvaDocument.transform.Transformer, line 51, in
to_source
Module Products.SilvaDocument.transform.base, line 196, in convert
Module Products.SilvaDocument.transform.kupu.htmlformat, line 886, in
convert
Module Products.SilvaDocument.transform.kupu.htmlformat, line 194, in
fix_structure
Module Products.SilvaDocument.transform.kupu.htmlformat, line 144, in
get_textbuf
Module Products.SilvaDocument.transform.base, line 196, in convert
Module Products.SilvaDocument.transform.kupu.silvaformat, line 254,
in convert
AttributeError: Context instance has no attribute 'model'
>
/home/wim/Buildouts/Silva-2.2-new/eggs/Products.SilvaDocument-2.2-py2.4.egg/Products/SilvaDocument/transform/kupu/silvaformat.py(254)convert()
-> pad = pathadapter.getPathAdapter(context.model.REQUEST)
Edit link
---------
When trying to edit the link you get:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Trident/4.0; GTB6.4; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR
3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Thu, 13 May 2010 15:27:20 UTC
Message: Exception thrown and not caught
Line: 185
Char: 13
Code: 0
URI: http://192.168.2.111:8080/clean-toc/service_kupu/kupueditor.js
More information about the silva-general
mailing list