[Zope-PTK] Re: Invalid index name
Dave Seidel
dave@superluminal.com
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
publish_module
File /www/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish
File /www/Zope/lib/python/Zope/__init__.py, line 211, in
zpublisher_exception_hook
File /www/Zope/lib/python/ZPublisher/Publish.py, line 165, in publish
File /www/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
(Object: Portal_add)
File /www/Zope/lib/python/ZPublisher/Publish.py, line 102, in call_object
(Object: Portal_add)
File /www/Zope/lib/python/OFS/DTMLMethod.py, line 156, in __call__
(Object: Portal_add)
File /www/Zope/lib/python/DocumentTemplate/DT_String.py, line 502, in
__call__
(Object: Portal_add)
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
(Object: apply_wizard(REQUEST))
(Info: REQUEST)
File <string>, line 0, in ?
File /www/Zope/lib/python/Products/PTKDemo/Portal.py, line 241, in
apply_wizard
(Object: DemoPortalBase)
AttributeError: (see above)
I'll try to track this down a little later, when I have more time.
-- Dave
----- Original Message -----
From: "Steve Alexander" <steve@cat-box.net>
To: <zope-ptk@zope.org>; <dave@superluminal.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
someone
> > else can offer a clue.
> >
> > I'm using CVS versions of both Zope and PTK, and I'm new to both. When
I
> > try to add a Portal to a folder, I get all the way through the wizard,
then
> > when I click on Finish, I get:
> >
> > Error Type: Invalid Index Name
> > Error Value: Cannot index fields beginning with "_"
> >
> > the traceback is:
> <deletia>
> > File /www/Zope/lib/python/DocumentTemplate/DT_With.py, line 148, in
render
> > (Object: Portal.createInObjectManager(REQUEST['id'], REQUEST))
> > File /www/Zope/lib/python/Products/PTKDemo/Portal.py, line 79, in
install
> > (Object: DemoPortalBase)
> > File /www/Zope/lib/python/Products/PTKBase/PortalCatalog.py, line 14,
in
> > 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
> see.
> """
>
> 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
> http://lists.zope.org/mailman/listinfo/zope-ptk
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests
>
>