Ticket #1646 (new defect)

Opened 3 years ago

Last modified 2 years ago

Doesn't work with Zope 2.9.2

Reported by: gracinet Assigned to: tziade
Priority: P2 Milestone: CPS 3.5.0
Component: CPSMailAccess Version: TRUNK
Severity: critical Keywords:
Cc:

Description

I think this is due to the changes in traversal introduced in Five 1.3.2, 1.3.3:

Error Type:  	TypeError
Error Value: 	

getReferences() takes exactly 2 arguments (1 given)

Traceback: 	

Traceback (innermost last):

    * Module ZPublisher.Publish, line 115, in publish
      (...)
    * Module Products.PageTemplates.TALES, line 221, in evaluate
      URL: index
      Line 38, Column 4
      Expression: standard:'here/getReferences'
      Names:

      {'container': <MailMessage at /cps/portal_webmail/box_antonin/INBOX/.303>,
       'context': <MailMessage at /cps/portal_webmail/box_antonin/INBOX/.303>,
       'default': <Products.PageTemplates.TALES.Default instance at 0x40d71a4c>,
       'here': <MailMessage at /cps/portal_webmail/box_antonin/INBOX/.303>,
       'loop': <Products.PageTemplates.TALES.SafeMapping object at 0x4430b20c>,
       'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x40da204c>,
       'nothing': None,
       'options': {'args': (<Products.Five.metaclass.SimpleViewClass from /home/zope/var/viral-prod.com/Products/CPSMailAccess/www/mailMessageView.zpt object at 0x4430be2c>,)},
       'repeat': <Products.PageTemplates.TALES.SafeMapping object at 0x4430b20c>,
       'request': <HTTPRequest, URL=https://viral-prod.com/portal_webmail/box_antonin/INBOX/.303/view>,
       'root': <Application at >,
       'template': <ImplicitAcquirerWrapper object at 0x442fa20c>,
       'view': <Products.Five.metaclass.SimpleViewClass from /home/zope/var/viral-prod.com/Products/CPSMailAccess/www/mailMessageView.zpt object at 0x4430be2c>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0x4430b0cc>}

    * Module Products.PageTemplates.Expressions, line 185, in __call__
    * Module Products.PageTemplates.Expressions, line 180, in _eval
    * Module Products.PageTemplates.Expressions, line 85, in render

TypeError: getReferences() takes exactly 2 arguments (1 given)

Now, given that:

  • MailMessage has no getReferences method
  • MailBox has a getReferences method with args (self, message)
  • MailMessageView has a getReferences method with args (self)

My interpretation is that this 'here' should be 'view'. Before the Five changes, there was an automagical view lookup, but now it gets the getReferences method from the mailbox object by acquisition, hence the error.

Needless to say, no prob on Zope 2.9.1

Change History

05/16/06 19:41:29 changed by sfermigier

What about Zope 2.9.3 now ?

05/17/06 16:50:30 changed by gracinet

Didn't test, but if I'm right, should be the same, according to Five 1.3.5's CHANGES.txt

05/19/06 17:22:47 changed by sfermigier

  • milestone changed from CPS 3.4.1 to CPS 3.4.2.

08/08/06 12:09:53 changed by lregebro

I fixed the obvious issues in [48156]. But yes, all view methods should be called with view/something instead of here/something. "here" really doesn't exist in Zope3, it' either "view" or "context" that's meant.