Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hoersche’s picture

quick unset? [first patch!]

Devin Carlson’s picture

Status: Active » Needs work

An unset should do the trick!

I just noticed a few things that could be cleaned up:

@@ -616,6 +616,10 @@ function file_entity_file_display_form($form, &$form_state, $file_type, $view_mo
+  //remove to prevent recursion
+  unset($formatters['file_field_file_rendered']);  ¶

The comment should follow Drupal commenting standards and there is extra whitespace after the semicolon.

@@ -23,3 +23,11 @@ configure = admin/structure/file-types
+
+
+; Information added by drush on 2013-08-10
+version = "7.x-2.0-unstable7+100-dev"
+core = "7.x"
+project = "file_entity"
+datestamp = "1376162522"
+

Extra code added by Drush.

@@ -4,3 +4,11 @@ package = Testing
+
+
+; Information added by drush on 2013-08-10
+version = "7.x-2.0-unstable7+100-dev"
+core = "7.x"
+project = "file_entity"
+datestamp = "1376162522"
+

Extra code added by Drush.

hoersche’s picture

Status: Needs work » Needs review
FileSize
1.21 KB

OK, trying again. Changed as suggested.

Status: Needs review » Needs work

The last submitted patch, media-removeformatter-2061625-3.patch, failed testing.

hoersche’s picture

Status: Needs work » Needs review
FileSize
1.3 KB

Oops. set EOL to Unix.

mirzu’s picture

Status: Needs review » Needs work

info file has two new lines and the test file has none. split the difference :)

hoersche’s picture

Status: Needs work » Needs review
FileSize
682 bytes

Done did it.

mirzu’s picture

Status: Needs review » Reviewed & tested by the community

Patch works as advertised. Removes the Rendered file mode from the file display options.

Dave Reid’s picture

Status: Reviewed & tested by the community » Needs work

I would actually love if we could use hook_field_formatter_info_alter() to add some kind of boolean 'flag' to indicate 'do not allow this formatter to be used a field formatter' so that other modules could do the same thing.

Dave Reid’s picture

Actually, file_entity provides this formatter, so it's just a matter of adding a boolean flag to file_entity_field_formatter_info() and then checking for that flag in each $formatter variable in file_entity_file_display_form().

Dave Reid’s picture

Another task is if you've already configured your file display to use 'Rendered file', does applying this patch cause your file field to not display properly anymore?

Devin Carlson’s picture

Status: Needs work » Needs review
FileSize
2.83 KB

A patch to implement the changes described in #10.

I made the check in file_entity_file_formatter_info() a bit more "complex" in order to keep the boolean's key in hook_field_formatter_info() simple (vs. something like 'is_not_a_file_formatter' => TRUE,).

hoersche’s picture

Status: Needs review » Reviewed & tested by the community

confirmed that 'Rendered file' is no longer an option on admin/structure/file-types/--type--/file-display after patch in #12

Devin Carlson’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.57 KB

Unfortunately, #12 makes the formatter unavailable in addition to hiding it from the UI.

A patch to just hide the formatter from the UI. It also hides the deprecated file entity image formatter since #2061531: Double 'Image' file formatter in the 'Manage file display' tab has been fixed.

Dave Reid’s picture

Status: Needs review » Fixed

Tweaked and committed #14 to 7.x-2.x! LAST ALPHA BLOCKER DONE.

http://drupalcode.org/project/file_entity.git/commit/f986ae3

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