A little patch correcting two errors that media and file entity the .dev version was throwing on the media display management forms on my wierd database.

In the patch to file_entity.admin.inc in my database the $current_displays[$name]['settings'] array element was set, but the element value was set to boolean false. isset(key =>booleanfalsevalue) returns true. Just added a check to see if the two values there were an array.

in media.fields.inc just added a check to see if $display['type'] was set before testing if its value was "media";

Comments

yareckon’s picture

StatusFileSize
new2.51 KB

Don't use me!

yareckon’s picture

Now without copy paste error.

effulgentsia’s picture

Status: Needs review » Fixed

Thanks. Fixed the first part with this: http://drupalcode.org/project/media.git/commitdiff/29f61b3?hp=18a277715a....

+++ b/includes/media.fields.inc
@@ -83,7 +83,7 @@ function media_field_formatter_settings_form($field, $instance, $view_mode, $for
-  if ($display['type'] == 'media') {
+  if (isset($display['type']) && $display['type'] == 'media') {

I did not commit this part. What's the scenario in which hook_field_formatter_settings_form() is called without $display['type'] being set? As far as I know, such a thing might indicate a real bug, for which you'd want the PHP notice being thrown. But, set this issue back to "needs review" if you disagree with that.

effulgentsia’s picture

I think I found the root cause of the bug you saw with $display['type'] not being set. Fixed in http://drupalcode.org/project/media.git/commitdiff/601859d?hp=29f61b340d....

Status: Fixed » Closed (fixed)

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