Ticket #12264 (reopened Bug)

Opened 4 years ago

Last modified 3 years ago

moderate comments gives AttributeError: author_name

Reported by: serhat Owned by:
Priority: minor Milestone: 4.x
Component: General Version: 4.2
Keywords: Cc: tisto, esteele, davilima6@…

Description

I am making a custom buildout with  http://dist.plone.org/release/4.1.1-pending/versions.cfg, the rest is pretty standard for Plone 4.1

Discussion settings:
comments enabled globally
no anonymous comments
comments moderation enabled
text transform - intelligent text
captcha - Captcha
commenter image shown
No moderator email notification
No moderator email
user email notification enabled

Types:
Default workflow - community workflow
Comment type - not allowed globally, comments allowed, not visible in searches, no versioning, comment review workflow

I have plone.app.discussion 2.0.10

Steps to produce error:
create a normal user
allow comments on the front page
log out and login with the normal user
make a comment on the front page
log out and login as admin
from the menu at top-right, click moderate comments
Plone gives an "AttributeError: author_name" exception

Also, in updateWidgets(self) in browser/comments.py:

  • self.widgets\['author_email'\].mode can be assigned twice
  • we already have portal_membership, why also create mtool ?


Here is the trace:
2011-10-07 14:15:40 ERROR Zope.SiteErrorLog 1317986140.480.965372220365  http://localhost:8080/mysite/@@moderate-comments
Traceback (innermost last):

Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module Products.PDBDebugMode.runcall, line 70, in pdb_runcall
Module ZPublisher.Publish, line 46, in call_object
Module plone.app.discussion.browser.moderation, line 33, in call
Module Products.Five.browser.pagetemplatefile, line 125, in call
Module Products.Five.browser.pagetemplatefile, line 59, in call
Module zope.pagetemplate.pagetemplate, line 113, in pt_render
Module zope.tal.talinterpreter, line 271, in call
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 858, in do_defineMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 946, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 858, in do_defineMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 852, in do_condition
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 821, in do_loop_tal
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 620, in do_insertText_tal
Module Products.PageTemplates.Expressions, line 225, in evaluateText
Module zope.tales.tales, line 696, in evaluate

  • URL: /var/Home/serhat/Dev/Plone/eggs/plone.app.discussion-2.0.10-py2.7.egg/plone/app/discussion/browser/moderation.pt
  • Line 106, Column 32
  • Expression: <PythonExpr (item.author_name or item.Creator)>
  • Names:

{'args': (),

'container': <PloneSite at /mysite>,
'context': <PloneSite at /mysite>,
'default': <object object at 0xb73846b0>,
'here': <PloneSite at /mysite>,
'loop': {},
'nothing': None,
'options': {},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xd9e0734>,
'request': <HTTPRequest, URL= http://localhost:8080/mysite/@@moderate-comments>,
'root': <Application at >,
'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xc625e0c>,
'traverse_subpath': [],
'user': <PropertiedUser 'admin'>,
'view': <Products.Five.metaclass.View object at 0xd95372c>,
'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0xd909f4c>}

Module zope.tales.pythonexpr, line 59, in call

  • traceback_info: (item.author_name or item.Creator)

Module <string>, line 1, in <module>

AttributeError: author_name

Change History

comment:1 Changed 4 years ago by jonstahl

  • Keywords python27 added
  • Priority changed from critical to minor

From discussion list, author reports that the problem disappears under Python 2.6, which means this is a probable incompatibility between Plone and Python 2.7, worth looking into for the near-future.

comment:2 follow-up: ↓ 3 Changed 4 years ago by kleist

Nice keyword, jonstal! I've created a Trac report for Python 2.7 related bugs: https://dev.plone.org/report/60

comment:3 in reply to: ↑ 2 Changed 4 years ago by jonstahl

  • Cc tisto, esteele added; contact@… removed

Replying to kleist:

Nice keyword, jonstal! I've created a Trac report for Python 2.7 related bugs: https://dev.plone.org/report/60

Fantastic, thank you!

comment:4 Changed 4 years ago by serhat

By the suggestion of Mr. Ritz, I checked catalog metadata for p.a.d columns and realized that they (total_comments,last_comment_date,commentators,in_response_to,author_name) fail to get added. when i add them, the problem goes away..

comment:5 Changed 4 years ago by davilima6

  • Cc davilima6@… added
  • Version set to 4.2

comment:6 Changed 4 years ago by kleist

  • Status changed from new to confirmed

comment:7 Changed 4 years ago by kleist

  • Component changed from Infrastructure to General

comment:8 Changed 4 years ago by kleist

  • Status changed from confirmed to closed
  • Resolution set to worksforme

Cannot reproduce using 4.3 coredev buildout.

serhat: Given that all these metadata columns seems to be defined...

 https://github.com/plone/plone.app.discussion/blob/master/plone/app/discussion/profiles/default/catalog.xml

... do you have a theory about why they hadn't been added?

comment:9 Changed 4 years ago by kleist

  • Keywords python27 removed

comment:10 Changed 3 years ago by mactrash

I just discover the same error in my plone site

Plone 4.2.1.1 (4207)

CMF 2.2.6

Zope 2.13.16

Python 2.7.3 (default, Sep 8 2012, 15:01:26) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)]

PIL 1.7.7 (Pillow)

You will not notice it until 1st comment waiting for approve (in my case), it return to normal when you allow / delete the comment under the content.

How can I fix it?

Last edited 3 years ago by mactrash (previous) (diff)

comment:11 Changed 3 years ago by mactrash

  • Status changed from closed to reopened
  • Resolution worksforme deleted
Note: See TracTickets for help on using tickets.