#13 — Improve call to ContentTypeRegistry

State Resolved
Version: 1.1.0
Area Functionality
Issue type Patch
Severity Medium
Submitted by Wolfgang Thomas
Submitted on Jun 08, 2011
Responsible
Target release: 1.1.1
Hi,

when the portal_type to be passed to the factory is determined with a lookup in the ContentTypeRegistry, the information provided is not sufficient.

The CTR's findTypeName() takes name, typ and body as parameters. Only name is passed in QuickUploadFile.quick_upload_file and flash_upload_file.

While this is fine for an ExtensionPredicate, it fails for a MajorMinorPredicate (e.g. major: "application", minor: ""), because the name isn't checked at all for that predicate. Therefore you can't easily default all "application/*" types to a different portal_type from File.

Passing the content_type as second parameter would solve this. See attached very simple patch.

Could you please apply it, or give me the ok to commit, if you agree with the patch?

Thanks,
Wolfgang
Attached:
Plain Text icon ctr_call.diff — Plain Text, 1 kB (1033 bytes)
Added by Thomas Desvenain on Jun 08, 2011 07:28 AM
Issue state: UnconfirmedConfirmed
Hi Wolfgang,

You're welcome to commit your patch :)
don't forget to add an entry in the changelog.

Thanks !

Thomas
Added by Wolfgang Thomas on Jun 08, 2011 07:32 AM
Cool, that was quick feedback! :-) Done.
Added by Thomas Desvenain on Jul 27, 2011 08:18 AM
Issue state: ConfirmedResolved
Target release: None1.1.1

No responses can be added.