supermodel + schemaeditor: trailing line field in Choice values entered
Sean Upton <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Message-ID | <CANjV-2MTO3oHEyUh8gp2ffK893t+vBpQuL9rjNLOF0CYWvQYbg@mail.gmail.com> |
Folks,
plone.supermodel chokes parsing schema created by plone.schemaeditor
when Choice field is input with one or more trailing line feeds at the
end of the values.
This leads to serialized XML that looks like:
<values>
<element>A</element>
<element>B</element>
<element></element>
</values>
Attempting to parse this breaks every time on
ChoiceHandler._constructField() trying to deal with a NoneType value.
http://pastie.org/8571776
Where should I look to fix this, in supermodel, schemaeditor, or both?
(1) schemaeditor should strip() the input.
(2) supermodel should, on export, omit blank terms.
(3) supermodel should, on import, ignore NoneType values
Any of these would solve my specific problem, but it seems prudent to
implement all?
Sean
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk