Ticket #13777 (new Bug)

Opened 2 years ago

Archetypes text/x-web-intelligent field fails validation

Reported by: lentinj Owned by:
Priority: minor Milestone: 4.x
Component: Unknown Version: 4.3
Keywords: archetypes Cc:

Description

I have a form that uses text/x-web-intelligent in exactly the way Martin describes at the end of this page:

 http://plone.org/documentation/kb/portal-transforms/using-the-transforms

This worked fine with Plone 4.0 / Products.Archetypes 1.6.6. However Plone 4.3.1 / Products.Archetypes 1.9.1 assumes the content of the field is text/plain when validating and fails, since text/plain isn't in allowable_content_types.

I tried adding in "text/x-tex" into the allowed types too, which resulted in the dropdown selection being shown, but whatever I selected it was assumed to be "text/plain".

Looking deeper at Products/Archetypes/Field.py, validate_content_types() seems to have no branch that would potentially use the default_content_type, nor is it obvious at what stage it would fall back to it.

I tried adding a clause to use getContentType() if it exists, but that only returns the default if guess_content_type() returns None. guess_content_type in this case returns text/plain (not an unreasonable guess).

I don't know enough about Archetypes to say when a fallback to default_content_type should be inserted.

Possibly related to #7577

Note: See TracTickets for help on using tickets.