[Zope] Re: zForum problem (partially solved: zForum bug!)

burley at zonnet.nl burley at zonnet.nl
Thu Mar 24 09:59:59 EST 2005


It took me (as a Zope newbie) quite a bit of time to get zForum working in my
non-standard setup. The causes were twofold:
1) Incorrect CookieCrumbler import when using the one from CMFCore (instead of
standalone)
2) zForum doesn't reckon with non-default 'Products' directories (these can be
set by the 'products' variable in zope.conf -- as it happens in my case).

I've send an updated version to zForum developer Julian Flores
(jflores at codeit.com). I expect a new version will come out some time.

Citeren "burley at zonnet.nl" <burley at zonnet.nl>:

> OK, I solved the next problem (first was a bad CookieCrumbler import in
> the
> zForum.py module):
> 
> In my zope.conf setup, I've set 'products = my_products_path' where of
> course
> zForum was installed (and shows up in the ZMI 'add Products list'.
> However,
> when a zForum object is instantiated, the zForum module only looks in
> Zope's
> default product path (.../instance/Products); hence my undefined
> 'files_dir'
> variable! Here's the zForum patch:
> 
> from Products import __path__  # list of all the products paths (default
> and
> set in zope.conf)
> 
> and replace (at line 172):
> 
> for k in [INSTANCE_HOME, SOFTWARE_HOME]:
>    location = os.path.join(k, 'Products', 'zForum', 'www', 'forum_main')
> 
> with:
> 
> product_paths = __path__
> product_paths += [INSTANCE_HOME+'/Products', SOFTWARE_HOME+'/Products']
> for k in product_paths:
>      location = os.path.join(k, 'zForum', 'www', 'forum_main')
> 
> This solves number 2. ... Up to problem number 3: at zForum instantiation
> now
> I get the error traceback (much deeper in the zForum.py module):
> """
> Request URL  
> http://localhost:8080/mfts.nl/manage_addProduct/zForum/manage_addZForum
> Exception Type 	AttributeError
> Exception Value 	addAnnouncement
> 
> Traceback (innermost last):
> 
>     * Module ZPublisher.Publish, line 101, in publish
>     * Module ZPublisher.mapply, line 88, in mapply
>     * Module ZPublisher.Publish, line 39, in call_object
>     * Module Products.zForum.zForum, line 90, in manage_addZForum
>     * Module Products.zForum.zForum, line 2469, in changePermissions
> 
> AttributeError: addAnnouncement
> """
> where line 2469 corresponds in my patched zForum.py file with the line:
> """
> zforum.sql.addAnnouncement.manage_permission('Access contents
> information',('Manager', 'Reviewer',),0)
> """
> Apparently, the zforum.sql object has no addAnnouncement attribute in my
> case.
> Why not?
> 
> 
> Citeren Cliff Ford <Cliff.Ford at ed.ac.uk>:
> 
> > Confirmation: I do have the Stand Alone version of CookieCrumbler, used 
> > just to test out zForum, and mentioned in my message (below), but I know
> 
> > this subtle difference may not have been obvious.
> > 
> > Cliff
> > 
> > Malcolm Cleaton wrote:
> > > I had five minutes, so I tried this too, and it also didn't work for
> me.
> > > 
> > > I tracked the error down to line 55 of zForum.py
> > > 
> > > Instead of:
> > > from Products.CMFCore.CookieCrumbler import CookieCrumbler
> > > 
> > > it should be:
> > > import Products.CMFCore.CookieCrumbler
> > > 
> > > The manage_addCC method is in the module, not in the class.
> > > 
> > > I suspect people for whom this works have the standalone
> CookieCrumbler
> > > product, not the one included in CMFCore?
> > > 
> > > Thanks,
> > > Malcolm.
> > > 
> > > 
> > > On Wed, 23 Mar 2005 16:07:28 +0100, burley wrote:
> > > 
> > > 
> > >>I've gone through your details, yet I'm still stuck ;-( :
> > >>
> > >>Cookie Crumbler is in the 'Add dropdown' list. Further, I try to
> > keepthings
> > >>simple as possible: zForum   creation in root folder ("/"),
> > singleacl_user
> > >>('zope', who is the Manager and by default has all  permissions
> > including
> > >>read/write permissions.); these all are aquired by CookieCrumbler,
> > zForum
> > >>folders however do not exist at this stage since zForum doesn't get
> past
> > its
> > >>instantiation. The error message:
> > >>
> > >>"""
> > >>Error Type: AttributeError
> > >>Error Value: manage_addCC
> > >>"""
> > >>
> > >>keeps popping up again and again. The zope manager's password in
> > acl_users is
> > >>different from that used in the database connection string; that can't
> > be
> > >>theproblem can it...?
> > >>
> > >>Citeren Cliff Ford <Cliff.Ford at ed.ac.uk>:
> > >>
> > >>
> > >>>Forgot to cc the list in the last reply. Line 142 of zForum.py says:
> > >>>
> > >>>CookieCrumbler.manage_addCC('cookie_authentication')
> > >>>
> > >>>and the error message is saying that it can't find manage_addCC in 
> > >>>CookieCrumbler (I have taken out the rest of the Error log from this 
> > >>>reply because it contained a plain text database connection string).
> > >>>
> > >>>Check that your Add dropdown list has Cookie Crumbler (Standalone) in
> 
> > >>>its list and that the Zope user has read/write access to the 
> > >>>CookieCrumbler and zForum folders.
> > >>>
> > >>>I have a test zForum installed and it just worked! If I create another
> 
> > >>>with a dud database connection string I get a database error when
> trying
> > 
> > >>>to View (the installation appeared to work OK).
> > >>>
> > >>>Cliff
> > >>>
> > >>>H Jansen wrote:
> > >>>
> > >>>>Yep, that works. Here we go:
> > >>>>
> > >>>>Exception traceback
> > >>>>
> > >>>>Time
> > >>>>2005/03/23 14:08:12.432 GMT+1
> > >>>>User Name (User Id)
> > >>>>zope (zope)
> > >>>>Request URL
> >
> >>>>http://localhost:8080/mfts.nl/manage_addProduct/zForum/manage_addZForum
> > >>>>Exception Type
> > >>>>AttributeError
> > >>>>Exception Value
> > >>>>manage_addCC
> > >>>>
> > >>>>Traceback (innermost last):
> > >>>>
> > >>>>      * Module ZPublisher.Publish, line 101, in publish
> > >>>>      * Module ZPublisher.mapply, line 88, in mapply
> > >>>>      * Module ZPublisher.Publish, line 39, in call_object
> > >>>>      * Module Products.zForum.zForum, line 87, in manage_addZForum
> > >>>>      * Module Products.zForum.zForum, line 116, in __init__
> > >>>>      * Module Products.zForum.zForum, line 142, in zfSetupSystem
> > >>>>AttributeError: manage_addCC 
> > >>>>
> > >>>>
> > >>>
> > >>>... snip ...
> > >>>
> > >>>
> > >>>>On Wed, 2005-03-23 at 12:04, Cliff Ford wrote:
> > >>>>
> > >>>>
> > >>>>>Look at the Error Log for the Traceback, which tells you exactly
> where
> > 
> > >>>>>the error occurred. That can often help pinpoint the problem by
> module
> > 
> > >>>>>and line number - look at the Product code if necessary. Include the
> 
> > >>>>>Traceback in any question to the mailing list.
> > >>>>>
> > >>>>>Cliff
> > >>>>>
> > >>>>>burley at zonnet.nl wrote:
> > >>>>>
> > >>>>>
> > >>>>>>I've problems getting the zForum product working. When I try to
> > create
> > >>>
> > >>>azForum
> > >>>
> > >>>>>>instance somewhere in my Zope site, I invariably obtain the
> > >>>
> > >>>errormessage:
> > >>>
> > >>>>>>"""
> > >>>>>>Site ErrorAn error was encountered while publishing this resource.
> > >>>>>>
> > >>>>>>Error Type: AttributeError
> > >>>>>>Error Value: manage_addCC
> > >>>>>>"""
> > >>>>>>Looking for a solution on the internet, the closest I could get
> was
> > >>>>>>asdescribed in http://www.pcfltd.co.uk/docs/zforum.html (which is
> > >>>>>>aboutinstallation on a Windows machine; I'm working on Linux box).
> > >>>>>>
> > >>>>>>In the directory where I want to create the zForum:
> > >>>>>>1) I do have a database connection which is open en tested
> (works).
> > >>>>>>2) I do have a CookieCrumbler instance (which I'm not sure of
> > >>>
> > >>>whetherit's
> > >>>
> > >>>>>>essential or not...); the CookieCrubler properties are
> unchanged...
> > >>>
> > >>>(i.e.
> > >>>
> > >>>>>>__ac, __ac_name, __ac_password, etc)
> > >>>>>>3) In the zForum instance form I use the same connection string
> > >>>
> > >>>asdefined in
> > >>>
> > >>>>>>the database connection.
> > >>>>>>
> > >>>>>>The Site Error message keeps popping up all the time (...sigh).
> > >>>>>>Anyone some idea what's wrong...?
> > >>>>>>
> > >>>>>>
> > >>>
> > >>>_______________________________________________
> > >>>Zope maillist  -  Zope at zope.org
> > >>>http://mail.zope.org/mailman/listinfo/zope
> > >>>**   No cross posts or HTML encoding!  **
> > >>>(Related lists - 
> > >>> http://mail.zope.org/mailman/listinfo/zope-announce
> > >>> http://mail.zope.org/mailman/listinfo/zope-dev )
> > >>>
> > _______________________________________________
> > Zope maillist  -  Zope at zope.org
> > http://mail.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists - 
> >  http://mail.zope.org/mailman/listinfo/zope-announce
> >  http://mail.zope.org/mailman/listinfo/zope-dev )
> > 
> 
> 
> 
> 
> -- 
> _____________________________________________________________________
> Versatel ADSL Gratis. De voordelen van gratis internet met de
> snelheid van ADSL. Zonder abonnementskosten en zonder vast contract.
> Je betaalt alleen voor de tijd online. Nu zonder aansluitkosten en 
> met gratis modem. Bestel snel op www.versatel.nl.
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 




-- 
_____________________________________________________________________
Versatel ADSL Gratis. De voordelen van gratis internet met de
snelheid van ADSL. Zonder abonnementskosten en zonder vast contract.
Je betaalt alleen voor de tijd online. Nu zonder aansluitkosten en 
met gratis modem. Bestel snel op www.versatel.nl.



More information about the Zope mailing list