[Zope] Problem migrating from 2.6.3 to 2.7

robert rottermann robert at redcor.ch
Thu Feb 12 20:14:44 EST 2004


I had a similar problem tough I do not recall if it was caused ba a 
switch to 2.7
It was caused by a page template in which I had a test for the existence 
of  something (I do not recall the exact circumspects)
It was something like:
tal:define xx  here/myobject
tal:condition=" xx "
this I had to change to
tal:condition="python: if xx == None"

HTH
RObert

Jean-Francois.Doyon at CCRS.NRCan.gc.ca wrote:

>Hello,
>
>I've just switched to 2.7 from 2.6.3 and everything seems to work well
>except for one rather bizarre event:
>
>I have a specific content type that can't be viewed, accessed or otherwise
>used/viewed in any way without sending Zope into an infinite loop!
>
>Here's the error I get:
>
>Zope Error
>Zope has encountered an error while publishing this resource.
>
>Error Type: RuntimeError
>Error Value: maximum recursion depth exceeded
>
>----------------------------------------------------------------------------
>----
>
>Troubleshooting Suggestions
>
>The URL may be incorrect. 
>The parameters passed to this resource may be incorrect. 
>A resource that this resource relies on may be encountering an error. 
>For more detailed information about the error, please refer to the HTML
>source for this page. 
>
>If the error persists please contact the site maintainer. Thank you for your
>patience. 
>
>Traceback (innermost last): 
>
>Module ZPublisher.Publish, line 94, in publish 
>Module Zope.App.startup, line 257, in recordMetaData 
>Module OFS.SimpleItem, line 333, in getPhysicalPath 
>Module OFS.SimpleItem, line 76, in <lambda> 
>Module OFS.SimpleItem, line 310, in getId 
>Module OFS.SimpleItem, line 76, in <lambda> 
>Module OFS.SimpleItem, line 310, in getId 
>Module OFS.SimpleItem, line 76, in <lambda> 
>Module OFS.SimpleItem, line 310, in getId 
>
>This is a CMF Content Type of the simplest kind really ... But this looks
>like it's not a CMF specific problem.
>
>I've attached the full definition for the content type below my signature in
>case it helps ...
>
>Anybody know what could be causing this ???
>
>Thanks,
>
>Jean-François Doyon
>Internet Service Development and Systems Support / Développement des
>services et soutien de systèmes Internet
>GeoAccess Division / Division GéoAccès
>Canada Center for Remote Sensing / Centre canadien de télédétection
>Natural Resources Canada / Ressources naturelles Canada
>http://atlas.gc.ca
>Phone: (613) 992-4902
>Fax: (613) 947-2410
>
>from Globals import InitializeClass
>from AccessControl import ClassSecurityInfo
>from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent
>from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
>from Products.CMFDefault.File import File
>from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
> 
>factory_type_information = {
>        'id'                    : 'Macromedia Flash File',
>        'meta_type'             : 'Macromedia Flash File',
>        'description'           : ('Object representing Macromedia
>Flash/Director/etc ... files.'),
>        'product'               : 'Atlas',
>        'icon'                  : 'document_icon.gif',
>        'factory'               : 'addFlashFile',
>        'immediate_view'        : 'metadata_edit_form',
>        'actions'               :
>        ({
>                'id'            : 'view',
>                'name'          : 'View',
>                'action'        : 'flashfile_view',
>                'permissions'   : (View,),
>                'category'      : 'object'
>        },
>        {       'id'            : 'edit',
>                'name'          : 'Edit',
>                'action'        : 'flashfile_edit_form',
>                'permissions'   : (ModifyPortalContent,),
>                'category'      : 'object'
>        },
>        {
>                'id'            : 'metadata',
>                'name'          : 'Metadata',
>                'action'        : 'string:${object_url}/metadata_edit_form',
>                'permissions'   : (ModifyPortalContent,),
>                'category'      : 'object'
>        }),
>}
> 
>def addFlashFile(self, id):
>    """Create a Flash File"""
>    flashfile_object = FlashFile( id )
>    self._setObject(id, flashfile_object)
> 
>class FlashFile(File):
> 
>    portal_type = meta_type = 'Macromedia Flash File'
> 
>    security = ClassSecurityInfo()
> 
>    def __init__(self, id):
>        DefaultDublinCoreImpl.__init__(self)
>        self.id = id
> 
>    security.declareProtected(ModifyPortalContent, 'edit')
> 
>    def edit(self, precondition='', file='', height='', width='', source =
>'', supptext = ''):
>        """ Update and reindex. """
>        self._edit(precondition, file)
>        self.height = height
>        self.width = width 
>        self.source = source 
>        self.supptext = supptext 
>        self.reindexObject() 
> 
>    security.declareProtected(View, 'CookedText')
>         
>    def CookedText(self): 
>        pt = ZopePageTemplate( '', self.supptext, 'text/html' ).__of__( self
>) 
>        cookedtext = pt() 
>        return cookedtext 
>         
>    security.declareProtected(View, 'getHeight') 
>         
>    def getHeight( self ):
>        return getattr( self, 'height', '' )
>                 
>    security.declareProtected(View, 'getWidth') 
>                 
>    def getWidth( self ): 
>        return getattr( self, 'width', '' )
>         
>    security.declareProtected(View, 'getSource')
>                 
>    def getSource( self ): 
>        return getattr( self, 'source', '')
>          
>    security.declareProtected(View, 'getSuppText')
>                 
>    def getSuppText( self ): 
>        return getattr( self, 'supptext' ,'' ) 
>                 
>InitializeClass(FlashFile) 
>
>_______________________________________________
>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 )
>
>
>  
>




More information about the Zope mailing list