[Product-Developers] Re: Product-Developers Digest, Vol 21, Issue 6

Jim Baack jhb01 at thebaacks.com
Wed Nov 12 17:41:32 UTC 2008


> 
> Message: 1
> Date: Mon, 10 Nov 2008 22:20:10 +0100
> From: Davide Corio <davide.corio at domsense.com>
> Subject: [Product-Developers] remember and membrane
> To: product-developers at lists.plone.org
> Message-ID: <1226352010.1018.44.camel at sirah>
> Content-Type: text/plain
> 
> hi *,
> i created a member type, basing my work on the sampleremember code.
> 
> it worked fine for a while, but now i can't register it as "default
> member type".
> the type is correctly selected into the membrane_tool, but it doesn't
> appear under the select box shown in the remember configlet.
> 
> the strange thing is that neither the membrane example type is shown
> into that select box (it worked too some month ago).
> 
> i tried with both plone 2.5 and 3.0 but the behavior is the same.
> 
> any hints? :(
> 
> 
> -- 
> Davide Corio
> email: davide.corio<at>domsense.com
> web: http://www.domsense.com
> 

Davide-

Not sure if when you say "It worked fine for a while" that you mean you now have a newer version of remember or not. I had a problem where a new version of remember had the code below that didn't seem to work with my version of Plone (3.1.x). I didn't notice it until I did a 'bin/zopectl fg' - until then I was silently getting no membrane types.

The code - in remember/utils.py:

	def getRememberTypes(context):
 	    """
 	    Return a list of all the membrane types that implement IReMember.
 	    """
 	    attool = getToolByName(context, 'archetype_tool')
 	    mbtool = getToolByName(context, MBTOOLNAME)
 	    mbtypes = set(mbtool.listMembraneTypes())
 	    remtypes = [t.getId() for t in
 	                attool.listPortalTypesWithInterfaces([IReMember])]
 	    remtypes = set(remtypes)
 	    return list(mbtypes.intersection(remtypes))

listPortalTypesWithInterfaces() wasn't working, resulting in an empty return.

As a simple workaround, I changed this to:

	def getRememberTypes(context):
 	    """
 	    Return a list of all the membrane types that implement IReMember.
 	    """
 	    attool = getToolByName(context, 'archetype_tool')
 	    mbtool = getToolByName(context, MBTOOLNAME)
 	    mbtypes = set(mbtool.listMembraneTypes())
            return list(mbtypes)

In my case, all membrane types are in fact remember types and I'm OK. Don't know if this is related to your problem or not.


Jim






More information about the Product-Developers mailing list