[Product-Developers] at schemaextender not working right with portal factory

Nathan Van Gheem vangheem at gmail.com
Fri Sep 14 12:43:06 UTC 2012


When do you add the interface to the instance? It must not be getting added
to the portal_factory instance.

On Fri, Sep 14, 2012 at 6:17 AM, Petri Savolainen
<petri.savolainen at iki.fi>wrote:

> On 12 September 2012 19:55, ajung <lists at zopyx.com> wrote:
>
>> at.schemaextender is known to work without issues with or
>> without portal_factory.
>>
>
> Well I guess I might come up with the exception proving the rule then ;/
> Thanks for confirming there are no known issues.
>
> Let me rephrase, just to avoid any unintended ambiguity: I am trying to
> extend content per-instance: the marker interface is assigned to the
> instance run-time, right after the instance is created. So this is not
> about the usual (?) way, ie. type-wide extension configured statically,
> which I've found to work perfectly, as well.
>
> Here's what I did to recreate the issue (ie. initial AT edit form not
> including schema extension when portal factory is used):
>
> Using a clean plone 4.2.1 buildout (latest OSX w/python 2.7), empty
> egg-cache and a simple zope/plone package with paster, I dropped this
> simplified 'extension.py' python module <http://pastebin.com/L95m1h58>
>  and configure.zcml <http://pastebin.com/xvFtFby5> inside the pkg to hook
> things up so that any ATEvents created will be schema-extended as soon as
> they are created.
>
> Which again works fine, except that with portal factory, the initial edit
> form does not include the added field ("Cost"). Subsequent edit forms again
> do, as they should.
>
> I'd appreciate if someone could take a look & try it out.
>
> Thanks,
>
>  Petri
>
>
>
>
>
>
>> Petri Savolainen wrote
>> >
>> > Hello,
>> >
>> > I have an add-on whereby ATEvents are atschema-extended only if they are
>> > created inside a folder with a particular interface. This is done by
>> > listening for the ATEvent creation event and then checking the parent in
>> > the event handler.
>> >
>> > This works fine when portal factory is not used, but with it, the
>> initial
>> > AT creation/edit form gets rendered using the original schema, not the
>> > extended one. Upon subsequent edits of the new instance, the schema is
>> > there and everything works as it should.
>> >
>> > Any advice would be appreciated. I took a look at the FactoryTool,
>> > BaseObject and Schema sources already, but got pretty much nowhere, nor
>> > did
>> > Google find anything about this.
>> >
>> > Thanks,
>> >
>> >  Petri
>> >
>> > _______________________________________________
>> > Product-Developers mailing list
>> > Product-Developers at .plone
>> > https://lists.plone.org/mailman/listinfo/plone-product-developers
>> >
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://plone.293351.n2.nabble.com/at-schemaextender-not-working-right-with-portal-factory-tp7558931p7558950.html
>> Sent from the Product Developers mailing list archive at Nabble.com.
>> _______________________________________________
>> Product-Developers mailing list
>> Product-Developers at lists.plone.org
>> https://lists.plone.org/mailman/listinfo/plone-product-developers
>>
>
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> https://lists.plone.org/mailman/listinfo/plone-product-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20120914/20da31c7/attachment.html>


More information about the Product-Developers mailing list