Can't load plone.app.vocabularies.ReallyUserFriendlyTypes

classic Classic list List threaded Threaded
3 messages Options
Luca Fabbri Luca Fabbri
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can't load plone.app.vocabularies.ReallyUserFriendlyTypes

Hi all,

I've a strange behavior.

In a custom product I'm populating a plone.arr.registry form using two
vocabularies, one taken from the product itself, the other is the
common "plone.app.vocabularies.ReallyUserFriendlyTypes" given by
Plone.

On Plone 4.2 all is ok. On plone 3.3 I get an error when opening the
registry panel; the error is get from zope.schema._field.bind method:

    ...
    elif clone.vocabulary is None and self.vocabularyName is not None:
        vr = getVocabularyRegistry()
        clone.vocabulary = vr.get(object, self.vocabularyName)
        assert ISource.providedBy(clone.vocabulary)

I get the assert error because the call to "vr.get(object,
self.vocabularyName)" return None. It seems that the
"plone.app.vocabularies.ReallyUserFriendlyTypes" is not there.

Any suggestion? If i change (just for testing) the
"plone.app.vocabularies.ReallyUserFriendlyTypes" vocabulary with the
other one distirbuted with the product, all is working properly.

... any suggestion?

--
-- luca

twitter: http://twitter.com/keul
linkedin: http://linkedin.com/in/lucafbb
blog: http://blog.keul.it/

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Dieter Maurer Dieter Maurer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't load plone.app.vocabularies.ReallyUserFriendlyTypes

Luca Fabbri <[hidden email]> writes:

> In a custom product I'm populating a plone.arr.registry form using two
> vocabularies, one taken from the product itself, the other is the
> common "plone.app.vocabularies.ReallyUserFriendlyTypes" given by
> Plone.
>
> On Plone 4.2 all is ok. On plone 3.3 I get an error when opening the
> registry panel; the error is get from zope.schema._field.bind method:
>
>     ...
>     elif clone.vocabulary is None and self.vocabularyName is not None:
>         vr = getVocabularyRegistry()
>         clone.vocabulary = vr.get(object, self.vocabularyName)
>         assert ISource.providedBy(clone.vocabulary)
>
> I get the assert error because the call to "vr.get(object,
> self.vocabularyName)" return None. It seems that the
> "plone.app.vocabularies.ReallyUserFriendlyTypes" is not there.
>
> Any suggestion? If i change (just for testing) the
> "plone.app.vocabularies.ReallyUserFriendlyTypes" vocabulary with the
> other one distirbuted with the product, all is working properly.
>
> ... any suggestion?

I would try to learn how the vocabulary registry works
and (consequently) how the registration process works.

Then, I would try to understand why the "ReallyUserFriendlyTypes"
is registered in Plone 4 but not in Plone 3.


Registration might be ZCML based. In this case, the difference
might be the use of "z3c.autoinclude". If the registration
is ZCML based, you might try to explicitely include the
ZCML file registering the "ReallyUserFriendlyTypes" in your buildout.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Luca Fabbri Luca Fabbri
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can't load plone.app.vocabularies.ReallyUserFriendlyTypes

On Tue, Aug 28, 2012 at 8:59 AM, Dieter Maurer <[hidden email]> wrote:

> Luca Fabbri <[hidden email]> writes:
>
>> In a custom product I'm populating a plone.arr.registry form using two
>> vocabularies, one taken from the product itself, the other is the
>> common "plone.app.vocabularies.ReallyUserFriendlyTypes" given by
>> Plone.
>>
>> On Plone 4.2 all is ok. On plone 3.3 I get an error when opening the
>> registry panel; the error is get from zope.schema._field.bind method:
>>
>>     ...
>>     elif clone.vocabulary is None and self.vocabularyName is not None:
>>         vr = getVocabularyRegistry()
>>         clone.vocabulary = vr.get(object, self.vocabularyName)
>>         assert ISource.providedBy(clone.vocabulary)
>>
>> I get the assert error because the call to "vr.get(object,
>> self.vocabularyName)" return None. It seems that the
>> "plone.app.vocabularies.ReallyUserFriendlyTypes" is not there.
>>
>> Any suggestion? If i change (just for testing) the
>> "plone.app.vocabularies.ReallyUserFriendlyTypes" vocabulary with the
>> other one distirbuted with the product, all is working properly.
>>
>> ... any suggestion?
>
> I would try to learn how the vocabulary registry works
> and (consequently) how the registration process works.
>
> Then, I would try to understand why the "ReallyUserFriendlyTypes"
> is registered in Plone 4 but not in Plone 3.
>
>
> Registration might be ZCML based. In this case, the difference
> might be the use of "z3c.autoinclude". If the registration
> is ZCML based, you might try to explicitely include the
> ZCML file registering the "ReallyUserFriendlyTypes" in your buildout.
>
>

Seems some kind of issue with Plone 3.3.

First of all: I included explicitly the plone.app.vocabularies zcml,
but this not helped.

It seems that, when the ReallyUserFriendlyTypesVocabularyFactory
vocabulary is called from the field, the context is a "RecordsProxy"
object, not a Plone context.

Looking at the ReallyUserFriendlyTypesVocabularyFactory
implementation: it try to load from the proxy object the portal_types
tool, using getToolByName.
This obviously fails.

On Plone 4 instead, the context is not used but a "getStite" method is
called. I fear this is not fixable on Plone 3 (the last
plone.app.vocabularies version of branch 1.x is 1.0.8, that have the
issue)

Thanks for helping!

--
-- luca

twitter: http://twitter.com/keul
linkedin: http://linkedin.com/in/lucafbb
blog: http://blog.keul.it/

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Loading...