From 39195776b186369ab3fa689b7198f8b3c09b84c7 Mon Sep 17 00:00:00 2001
From: Dries <dries@buytaert.net>
Date: Wed, 16 May 2012 21:12:19 -0400
Subject: [PATCH] Patch #1552984 by Niklas Fiekas: Added Make 'File displayed
 by default' depend on 'Enable display field' with #states.

---
 core/modules/file/file.field.inc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
index a1a2ef9e57ba..482f096cfde4 100644
--- a/core/modules/file/file.field.inc
+++ b/core/modules/file/file.field.inc
@@ -50,6 +50,11 @@ function file_field_settings_form($field, $instance, $has_data) {
     '#title' => t('Files displayed by default'),
     '#default_value' => $settings['display_default'],
     '#description' => t('This setting only has an effect if the display option is enabled.'),
+    '#states' => array(
+      'visible' => array(
+        ':input[name="field[settings][display_field]"]' => array('checked' => TRUE),
+      ),
+    ),
   );
 
   $scheme_options = array();
-- 
GitLab