More on Re: [Zope-CMF] From the 'So close but so far' Department

Jeff Sasmor jeff@janix.com
Tue, 1 May 2001 11:39:51 -0400


>>Hi Jeff,

>>Are you using a mounted database by any chance?

Hello Chris,

No, no mounted database. The culprit was something
bad (?) I was doing.

Blark is a Portal Folder subclass that contains regular
portal Document class instances.  I found that if someone
were to use the normal portal search (say, using the
textfield in the 'top bar') then unpublished articles would
show up.

Clicking on such links cause various bad things to happen.
It's not possible to check published state of a Document
unless you're the owner (why not? I still think that's a
mistake) so that skins/generic/search can't be repaired.

So anyway, I thought I'd be smart and modify the view attribute
of a document to point to something else that could check the review
state (within python code it can be done) prior to displaying the
Document's content. When someone creates a new article for
Blark, a new Document instance is created, then I do:

        ob = self._getOb(str_id, self)
        ob.view = self.document_view

where document_view is defined in Blark.py.

This solves the problem, but Zope complains after you do it
a number (1<n<20) times. Beyond my Zen Level....

Oh well.....

Jeff

----history----

Date: Mon, 30 Apr 2001 18:42:05 -0400
From: Chris McDonough <chrism@digicool.com>
To: Jeff Sasmor <jeff@janix.com>
Cc: zope-cmf@zope.org
Subject:

Hi Jeff,

Are you using a mounted database by any chance?

Jeff Sasmor wrote:
>
> While trying to debug my "Blark" product I periodically run into the
> following error when trying to create a new posting.  Once it occurs,
> it continues to occur (that is, trying to create a new posting produces
the
> same message) until  Zope is restarted or the Blark product is restarted
> (using the nifty Refresh product).  Adding a Document from the
> Add Content page works fine even while the state is 'stuck' in
> InvalidObjectRefrence .
>
> I looked in the source but it's beyond my Zope Zen by a wide margin.
> Anyone have any idea what this means? I am using Zope 2.3.2 b2.
> I don't see anything that was changed in the 2.3.2 final that would
> impact this (whatever the &%*^% it is).
>
> --------------------------------------------------------------------------
--
> -------------
> Error Type: InvalidObjectReference
> Error Value: Attempt to store an object from a foreign database connection
>
> Traceback (innermost last):
>   File /usr/local/YB-Z232b2/lib/python/ZPublisher/Publish.py, line 223, in
> publish_module
>   File /usr/local/YB-Z232b2/lib/python/ZPublisher/Publish.py, line 187, in
> publish
>   File /usr/local/YB-Z232b2/lib/python/Zope/__init__.py, line 221, in
> zpublisher_exception_hook
>     (Object: Traversable)
>   File /usr/local/YB-Z232b2/lib/python/ZPublisher/Publish.py, line 175, in
> publish
>   File /usr/local/YB-Z232b2/lib/python/Zope/__init__.py, line 235, in
commit
>   File /usr/local/YB-Z232b2/lib/python/ZODB/Transaction.py, line 300, in
> commit
>   File /usr/local/YB-Z232b2/lib/python/ZODB/Connection.py, line 375, in
> commit
>     (Info: (('Products.CMFDefault.Document', 'Document'),
> '\000\000\000\000\000\000\'e', ''))
> InvalidObjectReference: (see above)
>
> --------------------------------------------------------------------------
--
> ------------------
>



Jeff Sasmor
jeff@sasmor.com
Check out http://www.naggle.com/