This is one way to solve problems with exporting file types, is to ensure that all the information for a file type is contained in our one table. I'm wondering why exactly we'd need three separate tables to store file types, when it might be complicating things.

Related:
#1845516: Custom file types exported through Features are missing mimetype information.
#1979832: Remove schemes from file types

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

This would also fix that file_entity_uninstall() needs to use API functions to load the file types.

Dave Reid’s picture

Note that #1979832: Remove schemes from file types would remove the file_type_streams table.

Dave Reid’s picture

Title: Merge the file_type_mimetypes and file_type_streams into serialized fields on the file_type table » Merge file_type_mimetypes into a serialized field on the file_type table

Reducing scope now that #1979832: Remove schemes from file types is committed.

Devin Carlson’s picture

Assigned: Dave Reid » Devin Carlson
Status: Active » Needs review
FileSize
63.6 KB
5.47 KB

A patch to store mimetypes in the {file_type} table as a serialized blob.

It includes an update function to migrate existing MIME types from {file_type_mimetypes} into {file_type}.

A screenshot showing that MIME type information is now exportable with Features!

exportable_mimetypes.png

Devin Carlson’s picture

Devin Carlson’s picture

Status: Needs review » Fixed

Tested #4 with a number of existing sites and didn't run into any upgrade path problems (only default file types, additional custom file types, file types with default/additional/no MIME types).

Committed to 7.x-2.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

venugopp’s picture

Status: Closed (fixed) » Fixed
FileSize
5.51 KB

With the above patch, it overwrites the default mimetypes.
It should migrate only the customised mimetypes.

Here is the patch for this.

aaron’s picture

Status: Fixed » Needs review
Dave Reid’s picture

Status: Needs review » Needs work

@pradeepvenugopal: That patch doesn't look correct. Can you make sure it's rolled against the very latest 7.x-2.x branch in Git?

venugopp’s picture

Status: Needs work » Closed (duplicate)

The fix is already available in the latest branch.

venugopp’s picture

Issue summary: View changes

Adding http://drupal.org/node/1979832 to related issues