[Zope-PTK] Yet another install failure for DemoPortal

Tres Seaver tseaver@palladion.com
Mon, 07 Feb 2000 18:11:07 -0600


Mike Pelletier wrote:
> 
> On Mon, 7 Feb 2000, Jim Cain wrote:
> 
> > I imported the DemoPortal and began to create a portal in my top-level
> > folder. On step 3 of the wizard, after clicking "Finish," I get the
> > following error:
> >
> > Error Type: TypeError
> > Error Value: not enough arguments; expected 6, got 3
> 
> >   File /usr/local/src/Zope/lib/python/Products/PTKDemo/Portal.py, line 56, in install
> >     (Object: DemoPortalBase)
> > TypeError: (see above)
> >
> > I'm getting closer, a little at a time. :-)
> 
>     Hmm.  In Portal.py (rev 1.31), this is the line:
> 
>         catalog.manage_addIndex('review_state', 'FieldIndex')
> 
>     This is the first line that an index is added.  Some people reported
> that ZCatalog doesn't even have a manage_addIndex method in their version,
> so I have changed this to add indexes and columns differently.  The change
> was made yesterday sometime.  I can't imagine why it would be expecting 6
> parameters in any case.

manage_addIndex() in my version of ZCatalog.py looks like::

  def manage_addIndex(self, name, type, REQUEST, RESPONSE, URL1):

The method just calls 'RESPONSE.redirect()' blindly, without checking that
anything reasonable was passed (ugh!).  Which version of Zope are you testing
with?

> 
>     Try updating to the latest version (run 'cvs up' in each of PTKBase
> and PTKDemo) and trying again.  Let me know!

No good :( -- see my other post.  Here is a patch which fixes it:

[zope@silver PTKDemo]$ cvs diff -c
cvs server: Diffing .
Index: Portal.py
===================================================================
RCS file: /cvs-repository/ZopePTK/PTKDemo/Portal.py,v
retrieving revision 1.1
diff -c -r1.1 Portal.py
*** Portal.py   2000/02/04 22:35:05     1.1
--- Portal.py   2000/02/08 00:12:59
***************
*** 53,72 ****
          self._setObject(id, catalog)
          catalog = self.SiteIndex
          # Reviewing indexes
!         catalog.manage_addIndex('review_state', 'FieldIndex')
!         catalog.manage_addIndex('Date', 'FieldIndex')
          # Content indexes
!         catalog.manage_addIndex('Creator', 'FieldIndex')
!         catalog.manage_addIndex('Title', 'TextIndex')
!         catalog.manage_addIndex('Description', 'TextIndex')
!         catalog.manage_addIndex('Searchable Text', 'TextIndex')
          # Catalog meta-data
!         catalog.manage_addColumn('Title')
!         catalog.manage_addColumn('Description')
!         catalog.manage_addColumn('review_state')
!         catalog.manage_addColumn('Creator')
!         catalog.manage_addColumn('Date')
!         catalog.manage_addColumn('icon')

          # Create roles
          self._addRole('Member')
--- 53,72 ----
          self._setObject(id, catalog)
          catalog = self.SiteIndex
          # Reviewing indexes
!         catalog._catalog.addIndex('review_state', 'FieldIndex')
!         catalog._catalog.addIndex('Date', 'FieldIndex')
          # Content indexes
!         catalog._catalog.addIndex('Creator', 'FieldIndex')
!         catalog._catalog.addIndex('Title', 'TextIndex')
!         catalog._catalog.addIndex('Description', 'TextIndex')
!         catalog._catalog.addIndex('Searchable Text', 'TextIndex')
          # Catalog meta-data
!         catalog._catalog.addColumn('Title')
!         catalog._catalog.addColumn('Description')
!         catalog._catalog.addColumn('review_state')
!         catalog._catalog.addColumn('Creator')
!         catalog._catalog.addColumn('Date')
!         catalog._catalog.addColumn('icon')

          # Create roles
          self._addRole('Member')

-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com