Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

Making GenericSetup property import less strict

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


wichert at wiggy

Feb 16, 2010, 2:37 AM

Post #1 of 2 (443 views)
Permalink
Making GenericSetup property import less strict

I am running into an interesting problem: it appears to be impossible to
write a FTI that works in both CMF 2.1 and 2.2. The problem are content
icons: CMF 2.1 requires a content_icon property in the FTI to configure
the icon, while CMF 2.2 requires icon_expr. Unfortunately you can not
have both in your FTI since GenericSetup will abort when it encounters
an unknown property. The only two possible solutions are to have
separate FTIs for CMF 2.1 an CMF 2.2, or to not use icons at all.
I would like to propose a simpler alternative: modify GenericSetup to
only log a warning when it encounters an unknown property instead of
aborting. That way we get automatic backward and forward compatibility
support, while not breaking anything.

Unless there are any objections I intend to make this change in svn
later this week.

Wichert.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


y.2010 at wcm-solutions

Feb 16, 2010, 2:53 AM

Post #2 of 2 (408 views)
Permalink
Re: Making GenericSetup property import less strict [In reply to]

Hi!


Wichert Akkerman wrote:
> I am running into an interesting problem: it appears to be impossible to
> write a FTI that works in both CMF 2.1 and 2.2. The problem are content
> icons: CMF 2.1 requires a content_icon property in the FTI to configure
> the icon, while CMF 2.2 requires icon_expr. Unfortunately you can not
> have both in your FTI since GenericSetup will abort when it encounters
> an unknown property. The only two possible solutions are to have
> separate FTIs for CMF 2.1 an CMF 2.2, or to not use icons at all.

This should work:

Just add 'content_icon'. CMF 2.1 knows that property and CMF 2.2 has
some migration code that converts this to an 'icon_expr' property.


HTH,

Yuppie
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] zope
https://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.