• Remember Mailing List

Re: install/migration problem

from Rob Miller on Oct 23, 2006 01:56 PM
Michael A Rowley, MD wrote:
>   *From: *   os2mac@... <mailto:os2mac@...>
> *Subject: * *install/upgrade help*
> *Date: * October 21, 2006 1:44:25 PM EDT
> *To: *   remember@... <mailto:remember@...>
> 
> Hello,
> 
> trying to move my project over to membrane/remember and having some 
> problems with the migration.  the project was originally written for 
> CMFMember,  I have 3 custom member types, and have converted them over 
> to remember, and have the site isntalling ok, but when I try to add a 
> member who is not of a default member type, I get an error:
> 
> Using Plone 2.4.3,
> Zope 2.9.5 final
> Plone 2.5.1
> membrane cvs-0.3-unreleased, checked out about the 14th of October
> remember cvs on the 14th also
> 
> I managed to get the isntall working,  which was a bit of a challenge 
> until i found the stuff in remember about the properies problem... had 
> to do that manually...
> 
> my Provider type is:
> 
> 

<---SNIP code for member type--->

> In testing, I try to add a member like so:
> 
> 
>>     def addProvider(self):
>>         md = self.mdata
>>         newId = self.portal.generateUniqueId('Provider')
>>         md.invokeFactory(type_name='Provider', id=newId)
>>         provider = md._getOb(newId)
>>         transaction.get().commit(True)
>>         provider.processForm(values=testProviderData)
>>         self.testProvId = provider.getId()
>>         self.provider = provider
>>
> 
> and get the following Error.
> 
> 
>> Error in test testPtDataContainerInstall 
>> (Products.TORCH2.tests.testInstall.testInstall)
>> Traceback (most recent call last):
>>   File 
>> "/Applications/Plone-2.5.1/lib/python/Testing/ZopeTestCase/profiler.py", 
>> line 86, in __call__
>>     self.setUp()
>>   File 
>> "/Applications/Plone-2.5.1/lib/python/Testing/ZopeTestCase/PortalTestCase.py", 
>> line 62, in setUp
>>     self.afterSetUp()
>>   File 
>> "/Applications/Plone-2.5.1/Instance/Products/TORCH2/tests/torchTestCase.py", 
>> line 64, in afterSetUp
>>     self.addProvider()
>>   File 
>> "/Applications/Plone-2.5.1/Instance/Products/TORCH2/tests/torchTestCase.py", 
>> line 79, in addProvider
>>     md.invokeFactory(type_name='Provider', id=newId)
>>   File 
>> "/Applications/Plone-2.5.1/Instance/Products/CMFCore/PortalFolder.py", 
>> line 408, in invokeFactory
>>     return pt.constructContent(type_name, self, id, RESPONSE, *args, **kw)
>>   File 
>> "/Applications/Plone-2.5.1/Instance/Products/CMFCore/TypesTool.py", 
>> line 934, in constructContent
>>     ob = info.constructInstance(container, id, *args, **kw)
>>   File 
>> "/Applications/Plone-2.5.1/Instance/Products/CMFCore/TypesTool.py", 
>> line 341, in constructInstance
>>     raise AccessControl_Unauthorized('Cannot create %s' % self.getId())
>> Unauthorized: Cannot create Provider

well, this indicates that your permissions aren't set up correctly.  if 
anonymous users are supposed to be able to create accounts, then you'll want 
to make sure that your type has an appropriate add permission, and to make 
sure that the permission is granted to anonymous users.

> I updated the portal_memberdata portal_types properties to allow a 
> Provider object, but still getting this error.
> 
> 
> when I try to do this through the web logged in as admin, I get the 
> following:
> 
> 
>> Traceback (innermost last):
>>
>>     * Module ZPublisher.Publish, line 115, in publish
>>     * Module ZPublisher.mapply, line 88, in mapply
>>     * Module ZPublisher.Publish, line 41, in call_object
>>     * Module Products.CMFFormController.FSControllerPageTemplate, line 
>> 96, in __call__
>>     * Module Products.CMFFormController.BaseControllerPageTemplate, 
>> line 39, in _call
>>     * Module Products.CMFFormController.ControllerBase, line 245, in 
>> getNext
>>       __traceback_info__: ['id = provider_edit', 'status = success', 
>> 'button=None', 'errors={}', 'context=<Provider at 
>> provider.2006-10-21.1494294206>', "kwargs={'portal_status_message': 
>> 'Your changes have been saved.'}", 'next_action=None', '']
>>     * Module Products.CMFFormController.Actions.TraverseTo, line 36, 
>> in __call__
>>     * Module ZPublisher.mapply, line 88, in mapply
>>     * Module ZPublisher.Publish, line 41, in call_object
>>     * Module Products.CMFFormController.FSControllerPythonScript, line 
>> 108, in __call__
>>     * Module Products.CMFFormController.Script, line 141, in __call__
>>     * Module Products.CMFCore.FSPythonScript, line 108, in __call__
>>     * Module Shared.DC.Scripts.Bindings, line 311, in __call__
>>     * Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
>>     * Module Products.CMFCore.FSPythonScript, line 164, in _exec
>>     * Module None, line 1, in content_edit
>>       <FSControllerPythonScript at /torch/content_edit used for 
>> /torch/portal_memberdata/provider.2006-10-21.1494294206>
>>       Line 1
>>     * Module Products.CMFCore.FSPythonScript, line 108, in __call__
>>     * Module Shared.DC.Scripts.Bindings, line 311, in __call__
>>     * Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
>>     * Module Products.CMFCore.FSPythonScript, line 164, in _exec
>>     * Module None, line 11, in content_edit_impl
>>       <FSPythonScript at /torch/content_edit_impl used for 
>> /torch/portal_memberdata/provider.2006-10-21.1494294206>
>>       Line 11
>>     * Module Products.Archetypes.BaseObject, line 645, in processForm
>>     * Module Products.Archetypes.BaseObject, line 634, in _processForm
>>       __traceback_info__: (<Provider at 
>> /torch/portal_memberdata/provider.2006-10-21.1494294206>, <Field 
>> id(string:rw)>, <bound method Provider.setId of <Provider at 
>> /torch/portal_memberdata/provider.2006-10-21.1494294206>>)
>>     * Module Products.Archetypes.utils, line 161, in mapply
>>     * Module Products.remember.content.member, line 92, in setId
>>
>> AttributeError: 'NoneType' object has no attribute 'setId'

hrm.  it looks like the line causing this error is:

      self.base_archetype.setId(self, value)

which would mean that self.base_archetype is None when this is being called. 
seems weird, b/c you have a 'base_archetype = atapi.BaseBTreeFolder' in your 
member class.  maybe you should put a pdb breakpoint 
(http://plone.org/documentation/how-to/using-pdb) in there and see whether or 
not this variable is correctly set when this code gets called.

> can anyone help me with this, or perhaps there is some working code I 
> can look at?  I have only intermittant access to the web right now, so 
> may be a couple of days before I can get back... Sorry for the delay, 
> but it is the life I lead right now. ;)Such as life is without the internet.

the only working custom member code that i know of right now is in the 
personalities product.  i'll be porting the custom member types for the 
openplans.org site forward from cmfmember to remember in the coming weeks, but 
haven't started yet.

> and anyway, sometimes asking the question seems to be cathartic, and I 
> can find an answer after I ask.  

hope that worked out for ya!

-r
Return to date view: threaded or flat