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

Petri Savolainen petri.savolainen at iki.fi
Fri Sep 14 11:17:15 UTC 2012


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20120914/ac600584/attachment-0001.html>


More information about the Product-Developers mailing list