[Product-Developers] SupermodelParseError: Field type plone.app.textfield.RichText specified for field body is not supported
David Glick (Plone)
david.glick at plone.org
Tue Dec 3 20:26:41 UTC 2013
On 12/3/13, 12:37 AM, ajung wrote:
> Hi there,
>
> I am receiving the following error using a simple Dexterity 2 based add-on
> within a text fixture under Plone 4.3.2:
>
> File
> "/home/ajung/.buildout/eggs/zope.testing-3.9.7-py2.7.egg/zope/testing/testrunner/runner.py",
> line 366, in run_layer
> setup_layer(options, layer, setup_layers)
> File
> "/home/ajung/.buildout/eggs/zope.testing-3.9.7-py2.7.egg/zope/testing/testrunner/runner.py",
> line 628, in setup_layer
> setup_layer(options, base, setup_layers)
> File
> "/home/ajung/.buildout/eggs/zope.testing-3.9.7-py2.7.egg/zope/testing/testrunner/runner.py",
> line 633, in setup_layer
> layer.setUp()
> File
> "/home/ajung/.buildout/eggs/plone.app.testing-4.2.2-py2.7.egg/plone/app/testing/helpers.py",
> line 339, in setUp
> self.setUpZope(portal.getPhysicalRoot(), configurationContext)
> File
> "/home/ajung/sandboxes/eteaching.policy/src/eteaching.policy/eteaching/policy/tests/base.py",
> line 34, in setUpZope
> xmlconfig.file('patches.zcml', eteaching.policy,
> context=configurationContext)
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py",
> line 649, in file
> include(context, name, package)
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py",
> line 548, in include
> processxmlfile(f, context)
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py",
> line 380, in processxmlfile
> parser.parse(src)
> File
> "/opt/buildout.python/parts/opt/lib/python2.7/xml/sax/expatreader.py", line
> 107, in parse
> xmlreader.IncrementalParser.parse(self, source)
> File "/opt/buildout.python/parts/opt/lib/python2.7/xml/sax/xmlreader.py",
> line 123, in parse
> self.feed(buffer)
> File
> "/opt/buildout.python/parts/opt/lib/python2.7/xml/sax/expatreader.py", line
> 210, in feed
> self._parser.Parse(data, isFinal)
> File
> "/opt/buildout.python/parts/opt/lib/python2.7/xml/sax/expatreader.py", line
> 341, in start_element_ns
> AttributesNSImpl(newattrs, qnames))
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py",
> line 232, in startElementNS
> self.context.begin(name, data, info)
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py",
> line 555, in begin
> self.stack.append(self.stack[-1].contained(__name, __data, __info))
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py",
> line 856, in contained
> return RootStackItem.contained(self, name, data, info)
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py",
> line 727, in contained
> adapter = factory(self.context, data, info)
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py",
> line 1224, in factory
> return ComplexStackItem(self, context, data, info)
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py",
> line 970, in __init__
> args = toargs(newcontext, meta.schema, data)
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py",
> line 1397, in toargs
> args[str(name)] = field.fromUnicode(s)
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/fields.py",
> line 137, in fromUnicode
> value = self.context.resolve(name)
> File
> "/home/ajung/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py",
> line 179, in resolve
> mod = __import__(mname, *_import_chickens)
> File
> "/home/ajung/sandboxes/eteaching.policy/src/eteaching.policy/eteaching/policy/test_folder.py",
> line 25, in <module>
> class ITestFolder(model.Schema, IImageScaleTraversable):
> File
> "/home/ajung/.buildout/eggs/plone.supermodel-1.2.3-py2.7.egg/plone/supermodel/model.py",
> line 67, in __init__
> self._SchemaClass_finalize()
> File
> "/home/ajung/.buildout/eggs/plone.supermodel-1.2.3-py2.7.egg/plone/supermodel/model.py",
> line 74, in _SchemaClass_finalize
> adapter()
> File
> "/home/ajung/.buildout/eggs/plone.supermodel-1.2.3-py2.7.egg/plone/supermodel/directives.py",
> line 164, in __call__
> model = loadFile(filename)
> File
> "/home/ajung/.buildout/eggs/plone.supermodel-1.2.3-py2.7.egg/plone/supermodel/__init__.py",
> line 24, in loadFile
> parsed_model = parser.parse(path, policy=policy)
> File
> "/home/ajung/.buildout/eggs/plone.supermodel-1.2.3-py2.7.egg/plone/supermodel/parser.py",
> line 71, in parse
> return _parse(source, policy)
> File
> "/home/ajung/.buildout/eggs/plone.supermodel-1.2.3-py2.7.egg/plone/supermodel/parser.py",
> line 144, in _parse
> readField(fieldElement, schemaAttributes, fieldElements, baseFields)
> File
> "/home/ajung/.buildout/eggs/plone.supermodel-1.2.3-py2.7.egg/plone/supermodel/parser.py",
> line 107, in readField
> raise ValueError("Field type %s specified for field %s is not supported"
> % (fieldType, fieldName, ))
> ZopeXMLConfigurationError: File
> "/home/ajung/sandboxes/eteaching.policy/src/eteaching.policy/eteaching/policy/configure.zcml",
> line 35.4
> SupermodelParseError: Field type plone.app.textfield.RichText specified
> for field body is not supported
> File
> "/home/ajung/sandboxes/eteaching.policy/src/eteaching.policy/eteaching/policy/models/eteaching.policy.testfolder.xml",
> line 3
> <field name="body" type="plone.app.textfield.RichText">
>
> The application works but the text fixture pukes...any idea why?
>
>
If you use a test fixture that loads plone.supermodel's ZCML, then you
must be sure to also load the ZCML for any packages that provide
supermodel support for additional field types, *before* you import
modules that use the model.load directive. This is not good, but hard to
fix.
David
More information about the Product-Developers
mailing list