[Zope-PTK] Re: Invalid index name
Thu, 27 Apr 2000 16:30:33 -0400
Thanks, Steve. Security's not an issue at this point, I'm experimenting on
a private server. Unfortunately, after making the changes you suggest, now
there's another error:
Error Type: AttributeError
Error Value: 'None' object has no attribute 'setMemberProperties'
Traceback (innermost last):
File /www/Zope/lib/python/ZPublisher/Publish.py, line 214, in
File /www/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish
File /www/Zope/lib/python/Zope/__init__.py, line 211, in
File /www/Zope/lib/python/ZPublisher/Publish.py, line 165, in publish
File /www/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
File /www/Zope/lib/python/ZPublisher/Publish.py, line 102, in call_object
File /www/Zope/lib/python/OFS/DTMLMethod.py, line 156, in __call__
File /www/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in
File /www/Zope/lib/python/DocumentTemplate/DT_With.py, line 148, in render
(Object: Portal.createInObjectManager(REQUEST['id'], REQUEST))
File /www/Zope/lib/python/DocumentTemplate/DT_Util.py, line 335, in eval
File <string>, line 0, in ?
File /www/Zope/lib/python/Products/PTKDemo/Portal.py, line 241, in
AttributeError: (see above)
I'll try to track this down a little later, when I have more time.
----- Original Message -----
From: "Steve Alexander" <email@example.com>
To: <firstname.lastname@example.org>; <email@example.com>
Sent: Thursday, April 27, 2000 3:24 PM
Subject: [Zope-PTK] Re: Invalid index name
> Dave wrote:
> > This may have been asked recently in the list, but I don't think there's
> > been a reply yet. Apparently the maintainer is offline, but maybe
> > else can offer a clue.
> > I'm using CVS versions of both Zope and PTK, and I'm new to both. When
> > try to add a Portal to a folder, I get all the way through the wizard,
> > when I click on Finish, I get:
> > Error Type: Invalid Index Name
> > Error Value: Cannot index fields beginning with "_"
> > the traceback is:
> > File /www/Zope/lib/python/DocumentTemplate/DT_With.py, line 148, in
> > (Object: Portal.createInObjectManager(REQUEST['id'], REQUEST))
> > File /www/Zope/lib/python/Products/PTKDemo/Portal.py, line 79, in
> > (Object: DemoPortalBase)
> > File /www/Zope/lib/python/Products/PTKBase/PortalCatalog.py, line 14,
> > initialize
> > (Object: ElementWithAttributes)
> > File /www/Zope/lib/python/Products/ZCatalog/Catalog.py, line 309, in
> > addIndex
> > Invalid Index Name: (see above)
> I didn't get this problem, but I just finished reading the PTK source
> (lucky me!).
> Alter lib/python/Products/PTKBase/PortalCatalog.py, line 14, to read:
> self._catalog.addIndex('allowedRolesAndUsers', 'KeywordIndex')
> instead of
> self._catalog.addIndex('_allowedRolesAndUsers', 'KeywordIndex')
> change line 47 to
> kw['allowedRolesAndUsers'] = list(user.getRoles()) + \
> instead of
> kw['_allowedRolesAndUsers'] = list(user.getRoles()) + \
> The other related line is in
> lib/python/Products/PTKBase/PortalContent.py, line 45:
> def _allowedRolesAndUsers(self, permission='View'):
> Return a list of roles and users with View permission.
> Used by PortalCatalog to filter out items you're not allowed to
> you'll also need to change this method name to remove the underscore.
> Watch out, though -- I have no idea what these changes do to the
> security of your PTK site!
> Steve Alexander
> Software Engineer
> Cat-Box limited
> Zope-PTK maillist - Zope-PTK@zope.org
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature