DraggableViews handlers changed.
Now all handlers are derived from a default handler which implements default methods. The current version of flag_weights produces a fatal error because of a missing get() method.
With the attached patch you stay compatible with the latest BETA and dev-snapshot of DraggableViews.

Index: draggableviews_handler_flag_weights.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flag_weights/Attic/draggableviews_handler_flag_weights.inc,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 draggableviews_handler_flag_weights.inc
--- draggableviews_handler_flag_weights.inc	26 Aug 2009 10:36:07 -0000	1.1.2.4
+++ draggableviews_handler_flag_weights.inc	18 Sep 2009 12:07:24 -0000
@@ -9,9 +9,10 @@
 /*
 * Implementation using the Flag Weight module.
 */
-class draggableviews_handler_flag_weights {
-
+class draggableviews_handler_flag_weights extends draggableviews_handler {
   function init($field_name, &$view) {
+    parent::init($field_name, &$view);
+
     // Check that the handler is being used on the right type of field.
     if ($view->field[$field_name]->table != 'flag_content') {
       drupal_set_message("This handler cannot be applied to this field - use Weight!");
@@ -23,9 +24,6 @@ class draggableviews_handler_flag_weight
     $relationship = $view->relationship['flag_content_rel'];
     $this->flag_id = $relationship->definition['extra'][0]['value'];
     $this->flag = flag_get_flag($relationship->options['flag']);
-
-    $this->view       = $view;
-    $this->pager      = $view->pager;
   }
 
   function save($nid, $value) {
@@ -35,27 +33,4 @@ class draggableviews_handler_flag_weight
 
     flag_weights_set_weight($this->flag_id, 'node', $nid, $uid, $value);
   }
-
-  function get_form_element($value, $attributes = array()) {
-    $options = array();
-    for ($i = $this->range_start; $i <= $this->range_end; $i++) $options[$i] = $i;
-
-    return array(
-      '#type'  => 'select',
-      '#name'  => $attributes['field_name'],
-      '#value' => $value,
-      '#options' => $options,
-      '#attributes' => array('class' => $attributes['class']),
-    );
-    break;
-  }
-
-  function set_range($start, $end) {
-    $this->range_start = $start;
-    $this->range_end   = $end;
-  }
-
-  function get_minimum_value() {
-    return -1;
-  }
 }
CommentFileSizeAuthor
flag_weights_draggableviews_update.patch2.02 KBsevi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jcmarco’s picture

Category: task » bug
Priority: Normal » Critical
Status: Active » Needs review

Tested and working fine.

The actual flag_weights is broken due to changes in draggable views

Thank you very much for this patch.

q0rban’s picture

Subscribing, and pasting in the error you get without this patch, so it's searchable:

Fatal error: Call to undefined method draggableviews_handler_flag_weights::get() in sites/all/modules/draggableviews/draggableviews.inc on line 173

q0rban’s picture

Status: Needs review » Reviewed & tested by the community

Tested and works.

lyricnz’s picture

Status: Reviewed & tested by the community » Fixed

Confirmed error, applied, retest, fixed. Thanks!

Status: Fixed » Closed (fixed)

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