From 1c97886175373e8c98ac526f7045d289896af0dc Mon Sep 17 00:00:00 2001
From: Lorenz Schori <lo@znerol.ch>
Date: Sat, 22 Oct 2011 14:22:00 +0200
Subject: [PATCH 1/3] Fix options in nodequeue field handler

* Implement new method option_definition() replacing method options()
* Fix copy paste typo (options['link_to_taxonomy'] instead of
  options['link_to_queue'])
* Use ctools #dependency instead of #states otherwise no controls are
  shown in field settings popup.
---
 .../views/nodequeue_handler_field_all_queues.inc   |   21 +++++++++----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/includes/views/nodequeue_handler_field_all_queues.inc b/includes/views/nodequeue_handler_field_all_queues.inc
index 82d935e..8b87d1f 100644
--- a/includes/views/nodequeue_handler_field_all_queues.inc
+++ b/includes/views/nodequeue_handler_field_all_queues.inc
@@ -10,11 +10,14 @@ class nodequeue_handler_field_all_queues extends views_handler_field_prerender_l
   /**
    * Provide meaningful defaults.
    */
-  function options(&$options) {
-    parent::options($options);
-    $options['link_to_queue'] = TRUE;
-    $options['limit'] = FALSE;
-    $options['qids'] = array();
+  function option_definition() {
+    $options = parent::option_definition();
+
+    $options['link_to_queue'] = array('default' => TRUE);
+    $options['limit'] = array('default' => FALSE);
+    $options['qids'] = array('default' => array());
+
+    return $options;
   }
 
   /**
@@ -25,7 +28,7 @@ class nodequeue_handler_field_all_queues extends views_handler_field_prerender_l
     $form['link_to_queue'] = array(
       '#title' => t('Link this field to queue arrange page'),
       '#type' => 'checkbox',
-      '#default_value' => !empty($this->options['link_to_taxonomy']),
+      '#default_value' => !empty($this->options['link_to_queue']),
     );
 
     $form['limit'] = array(
@@ -47,11 +50,7 @@ class nodequeue_handler_field_all_queues extends views_handler_field_prerender_l
       '#title' => t('Queues'),
       '#options' => $options,
       '#default_value' => $this->options['qids'],
-      '#states' => array(
-        'visible' => array(
-          ':input[name="options[limit]"]' => array('checked' => TRUE)
-        ),
-      ),
+      '#dependency' => array('edit-options-limit' => array(TRUE)),
     );
   }
 
-- 
1.7.4.1

