Now that File entity supports all of the file extensions that Media requires, Media no longer has to alter File entity's list of allowed extensions. The file_extensions Media variable and configuration form can be removed.

Files: 
CommentFileSizeAuthor
#6 2067283-remove-media-file-extensions.patch7.39 KBDave Reid
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2067283-remove-media-file-extensions.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#4 remove-file-extensions-variable-2067283-4.patch7.36 KBDevin Carlson
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch remove-file-extensions-variable-2067283-4.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#2 remove-file-extensions-variable-2067283-1.patch6.79 KBDevin Carlson
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch remove-file-extensions-variable-2067283-1.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Dave Reid’s picture

We should make sure to do an update hook with a merge of all the variables that were in the media variable, with the new file_entity variable extensions, which gets saved into the file_entity variable, to make sure any existing alpha1 sites don't lose any extensions.

Devin Carlson’s picture

Status:Active» Needs review
StatusFileSize
new6.79 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch remove-file-extensions-variable-2067283-1.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

A patch to replace media_variable_get('file_extensions') with variable_get('file_entity_default_allowed_extensions'), remove the variable's configuration interface and add an update function to delete the variable.

Devin Carlson’s picture

Status:Needs review» Needs work

Needs work per #1.

Devin Carlson’s picture

Status:Needs work» Needs review
StatusFileSize
new7.36 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch remove-file-extensions-variable-2067283-4.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

An updated patch to preserve any file extensions that were set in Media.

Dave Reid’s picture

+++ b/media.installundefined
@@ -1013,3 +1013,21 @@ function media_update_7212() {
+  $media_file_extensions = variable_get('media__file_extensions');
+  $file_entity_file_extensions = variable_get('file_entity_default_allowed_extensions', 'jpg jpeg gif png txt doc docx xls xlsx pdf ppt pptx pps ppsx odt ods odp mp3 mov mp4 m4a m4v mpeg avi ogg oga ogv weba webp webm')
+
+  // Preserve any custom file extensions.
+  if (!empty($media_file_extensions)) {
+    $combined_file_extensions = array_unique(array_merge($media_file_extensions, $file_entity_file_extensions));
+    variable_set('file_entity_default_allowed_extensions', $combined_file_extensions);

I think we'll need to do an implode() on the two variables before we can do an array_merge().

Dave Reid’s picture

StatusFileSize
new7.39 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 2067283-remove-media-file-extensions.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

I think this is a version ready to go.

Dave Reid’s picture

Status:Needs review» Fixed

Status:Fixed» Closed (fixed)

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

dialn’s picture

actualize this version and now I can not rename the file, the images are very large and there are no thumbnails.
Not because these features now eliminated the design looks very messy and I can not rename my files

ParisLiakos’s picture